130. Ora absolute x

add ORA absolute,X opcode ``0x1D``.

Lesson 130 of 356 · tests/chapter_01_cpu/test_130_ORA_absolute_x.py

Why this step exists

This permits ORA against full-address tables indexed by X while keeping address resolution separate from the operation's accumulator and flag semantics.

In this step, following unindexed absolute ORA in lesson 129, add only this code to `emulator/cpu/opcodes.py`:

def ora_absolute_x(cpu: CPU):
    addr = absolute_x(cpu)
    value = cpu.bus.read(addr)
    or_a(cpu, value)

OPCODE_TABLE = {
    ...
    0x1D: ora_absolute_x,
}

`emulator/cpu/addressing_modes.py::absolute_x fetches the little-endian base word before adding cpu.x. The handler reads that resolved address and passes its value to instructions.or_a`. A and Z/N change; X, Carry/Overflow, and memory are invariant; opcode plus word advances PC three bytes.

Misconception: X indexes the decoded address, not an operand byte or the data read from memory. Out of scope: ORA absolute,Y and indirect modes (lessons 131-133), followed by EOR and BIT in lessons 134-145.

Run this lesson

uv run pytest tests/chapter_01_cpu/test_130_ORA_absolute_x.py -v