FA-89415 / Instruction set emulation / Member archive
Pull past the page top leaves the stack page · case 05
Pulling with sp at 0xFF reads 0x200 and reports sp 0x100.
Case contract
Input [pc, sp, ops] for an 8-bit stack pointer addressing page 0x100. push stores at 0x100+sp then decrements sp (wrapping in 8 bits); pull increments sp (wrapping) then reads (unwritten bytes read 0). jsr t (3 bytes at pc) pushes (pc+2) high byte then low byte and jumps; rts pulls low then high and resumes at that address + 1 (16-bit wrap). pha v pushes v, pla pulls; both and nop advance pc by 1. Return [[pc, sp, pulled value or None] per op, sorted [address, byte] of written stack memory].
Why this case matters
Emulated call/return must reproduce the exact stack image because programs inspect and manipulate return addresses on the stack.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| pull wraps above page end | [[[1025, 255, 0], [1026, 256, 0], [1027, 257, 0]], []] | [[[1025, 255, 0], [1026, 0, 0], [1027, 1, 0]], []] | 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 ↗