Move-37 / Q Board 6502

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.

Address: $0200  |  3 bytes
A9 42 00
LDA #$42 → BRK

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.

Address: $0200  |  6 bytes
18 A9 15 69 27 00
CLC → LDA #$15 → ADC #$27 → BRK

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.

Address: $0200  |  8 bytes
A2 00 E8 E0 05 D0 FB 00
LDX #$00 → INX → CPX #$05 → BNE $0202 → BRK

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.

Address: $0200  |  7 bytes
A9 AA 48 A9 00 68 00
LDA #$AA → PHA → LDA #$00 → PLA → BRK

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.

Address: $0200  |  8 bytes
20 05 02 00 00 A9 FF 60
JSR $0205 → BRK  |  at $0205: LDA #$FF → RTS

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.

Address: $0200  |  12 bytes
A2 00 8A 9D 00 03 E8 E0 10 D0 F8 00
LDX #$00 → TXA → STA $0300,X → INX → CPX #$10 → BNE $0204 → BRK

Expected: X=$10, memory $0300: 00 01 02 … 0F