Exercise 1: Why $0050 and $1050 Assemble Differently — Possible Solution ==================================================================== WHY THEY LOOK SIMILAR IN SOURCE CODE ------------------------------ Both LDA $0050 and LDA $1050 look like the same kind of instruction in source form: "load the accumulator from this memory address." A programmer reading the source without thinking about encoding could easily assume they behave identically, just with different target addresses. WHY THEY ASSEMBLE DIFFERENTLY UNDERNEATH ------------------------------ Per this chapter's own explanation of zero page, the deciding factor is simply whether the target address fits in a single byte. $0050 is within the range $0000-$00FF (zero page), so its address can be represented with just one byte ($50). $1050 is outside that range -- it genuinely needs both bytes of a full 16-bit address ($10 and $50) to be represented at all. Per this chapter's own tip-box, a real assembler automatically chooses the SHORTER, faster zero-page encoding whenever the target address fits in one byte, since there's essentially never a reason to prefer the longer absolute form when the short form is available and reaches the exact same location. $1050 simply doesn't have that option -- it's too large to fit in a single address byte, so the assembler has no choice but to emit the longer, 3-byte absolute encoding. THE CONCRETE RESULT ------------------------------ LDA $0050 -> 2 bytes total (1 opcode byte + 1 address byte), 3 cycles LDA $1050 -> 3 bytes total (1 opcode byte + 2 address bytes), 4 cycles The difference isn't about what the instruction MEANS (both load the accumulator from a memory address) -- it's entirely about whether that specific address happens to fit inside the special zero-page range, which is a purely mechanical fact about the number $0050 vs. $1050, not something the programmer explicitly chooses in source code. WHY THIS WORKS AS AN ANSWER ------------------------------ It explains that the two instructions look alike in source precisely because they express the same operation, but differ underneath purely based on whether the target address fits in one byte -- a fact determined automatically by the assembler, using the exact mechanism (byte-fitting) the chapter's own tip-box describes.