133. Ora indirect y
add ORA (indirect),Y opcode ``0x11``.
Lesson 133 of 356 · tests/chapter_01_cpu/test_133_ORA_indirect_y.py
Why this step exists
This completes ORA's addressing forms by resolving a zero-page pointer and then adding Y, without duplicating the operation's result or flag logic.
In this step, complete ORA after lessons 125-132 by adding the following to `emulator/cpu/opcodes.py`:
def ora_indirect_y(cpu: CPU):
addr = indirect_y(cpu)
value = cpu.bus.read(addr)
or_a(cpu, value)
OPCODE_TABLE = {
...
0x11: ora_indirect_y,
}`emulator/cpu/addressing_modes.py::indirect_y fetches a zero-page pointer, reads its little-endian target with a wrapping high-byte lookup, and only then adds Y. The handler reads that indexed target and calls instructions.or_a`. A and Z/N may change; Carry/Overflow, memory, X, and Y are invariant; opcode plus operand advances PC two bytes.
Misconception: unlike (indirect,X), Y does not select the pointer location; it indexes the resolved target. Out of scope: EOR and BIT (lessons 134-145).
Run this lesson
uv run pytest tests/chapter_01_cpu/test_133_ORA_indirect_y.py -v