Zero-page indirect-Y addressing mode uses two adjacent zero-page bytes as a 16-bit base address, then adds Y to reach the final memory address. The syntax places the zero-page address in parentheses and Y after a comma: `(<zero-page address>),Y`. section 3.3.1
Set up the pointer by storing its low byte first and its high byte immediately after it. If `$05` contains `$00` and `$06` contains `$03`, the pair specifies `$0300`. With `Y = $06`, an operand written as `($05),Y` reaches `$0306`. section 3.3.1 section 3.3.2
The mode can use that calculated address for several operations:
- Load from it with `LDA ($05),Y`. If `$0306` holds `$EE`, A becomes `$EE`. section 3.3.1
- Store A through it with `STA ($05),Y`. With the pointer at `$0300`, `Y = $06`, and `A = $EE`, memory location `$0306` receives `$EE`. section 3.3.2
- Add the byte found through it with `ADC ($02),Y`. A pointer to `$0300` plus `Y = $02` reaches `$0302`; adding `$14` to A's `$10` produces `$24`. section 4.1.1
Follow one indirect-Y load
Store `$00` at `$05` and `$03` at `$06` to form the base address `$0300`. Store `$EE` at `$0306`, load Y with `$06`, then run `LDA ($05),Y`. The processor reads the two-byte address from zero page, adds Y, and loads the byte at `$0306` into A. section 3.3.1
Figure 3.13 Loading a value from memory using a calculated location
Use the diagram to trace the two-stage lookup: zero-page bytes provide the base address, and Y selects the final byte. section 3.3.1
