Skip to main content

Module regs

Module regs 

Source
Expand description

WDC 65C816 register file and processor-status flags.

The 65C816 has variable-width data paths: the accumulator A is 8- or 16-bit per the M status flag, and the index registers X/Y are 8- or 16-bit per the X status flag. In 8-bit index mode the high byte of X/Y is forced to zero. The hidden E (emulation) latch forces M/X to the 8-bit width and confines the stack to page $01.

See docs/cpu.md (“Registers and state”, “Emulation vs native mode”).

Structs§

Regs
The complete architectural register file of the 65C816.
Status
Processor status register P (8 bits) plus the hidden emulation latch is tracked separately on Regs. Bit layout matches the hardware P register so PHP/PLP round-trip exactly.