FA-89409 / Instruction set emulation / Member archive
Stack pointer sticks at zero · case 04
Pushing past the bottom of the stack page overwrites the same byte repeatedly.
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 |
|---|---|---|---|
| stack pointer wraps below page start | [[[769, 0, null], [770, 0, null], [771, 0, null], [772, 1, 51]], [[256, 89], [257, 51]]] | [[[769, 0, null], [770, 255, null], [771, 254, null], [772, 255, 89]], [[256, 68], [257, 51], [511, 89]]] | 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 ↗