Exercise 1: Tracing the 6502's UPDATE_MAX With Candidate 30, MAX 50 — Possible Solution ==================================================================== GIVEN ------------------------------ A (candidate) = 30 MAX (in memory) = 50 STEP BY STEP ------------------------------ CMP MAX computes A - MAX = 30 - 50 = -20. Per this chapter's own explanation of 6502 CMP semantics: Carry is SET if A >= MAX (no borrow needed), and Carry is CLEAR if A < MAX (a borrow was needed). Since 30 < 50, a borrow WAS needed, so Carry ends up CLEAR after this CMP. BCC SKIP branches when Carry is Clear. Since Carry is indeed clear here, the branch IS taken, jumping straight to SKIP — meaning the STA MAX instruction is skipped entirely. SKIP then executes RTS, returning from the subroutine without ever having updated MAX. RESULT ------------------------------ MAX is NOT updated. It remains 50 after the subroutine call, since the candidate (30) was smaller than the current MAX (50), and this comparison correctly recognized that and skipped the update. WHY THIS WORKS AS AN ANSWER ------------------------------ It computes the actual CMP subtraction, correctly applies the 6502's own Carry-Set-means-A-is-not-smaller convention as explained in this chapter, correctly determines that BCC's branch condition IS met, and states the final, unchanged value of MAX rather than just asserting "it doesn't update" without showing the reasoning.