Test Programs
Enter these programs via the hex keypad or keyboard. Press AD to set the address, DA to enter data mode, + to advance, and GO to run. Programs end with BRK ($00) which pauses the emulator automatically.
1. Hello World — Load & Verify
Loads the value $42 into the accumulator. After BRK, check the A register in the status panel — it should show $42.
A9 42 00
Expected: A=$42, Z=0, N=0
2. Addition — $15 + $27
Clears carry, loads $15 into A, adds $27. Result should be $3C in the accumulator.
18 A9 15 69 27 00
Expected: A=$3C, C=0, Z=0
3. Counting Loop — X counts to 5
Initialises X to 0, increments in a loop until X reaches 5. Tests branching and comparison.
A2 00 E8 E0 05 D0 FB 00
Expected: X=$05, Z=1, C=1
4. Stack Test — Push & Pull
Pushes $AA onto the stack, clears A, then pulls it back. Verifies stack operations work correctly.
A9 AA 48 A9 00 68 00
Expected: A=$AA, SP=$FD, N=1
5. Subroutine Call — JSR & RTS
Calls a subroutine at $0205 that loads $FF into A, then returns. Tests JSR/RTS and the stack.
20 05 02 00 00 A9 FF 60
Expected: A=$FF, PC at BRK handler (paused)
6. Memory Fill — Write pattern to $0300
Fills addresses $0300–$030F with their index value (00, 01, 02, … 0F). Check via the Memory viewer at $0300.
A2 00 8A 9D 00 03 E8 E0 10 D0 F8 00
Expected: X=$10, memory $0300: 00 01 02 … 0F