FA-89420 / Instruction set emulation / Member archive
Zero-page indexed address leaves page zero · case 05
zp,X with a large index addresses page one instead of wrapping inside page zero.
Case contract
Input [mode, operand, x, y, mem] with mem mapping decimal-string addresses to bytes (missing = 0). zp: operand & 0xFF. zpx: (operand + x) & 0xFF. abs: operand. absx: (operand + x) & 0xFFFF. absy: (operand + y) & 0xFFFF. ind: little-endian pointer at operand, where the high byte is fetched from the same page ((operand & 0xFF00) | ((operand + 1) & 0xFF)). indx: pointer at zero-page (operand + x) & 0xFF, high byte from the next zero-page byte (wrapping). indy: pointer at zero-page operand (high byte wrapping in zero page), plus y, wrapped to 16 bits.
Why this case matters
Addressing-mode decoding is the core of any 8-bit CPU emulator; page-wrap quirks are observable program behaviour.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero page indexed wraps | 277 | 21 | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗