-
1Reset the 6502
Toggle Reset, then toggle Step a few times. The 6502 respects RDY during its internal reset sequence. It's ready when every address LED is lit except the two lowest bits, which means it's reading the reset vector at
$FFFC. -
2Set the reset vector
Deposit
$00at$FFFC(low byte) and$02at$FFFD(high byte), so the program starts at$0200. The first 512 bytes are zero page and the stack. -
3Two ways to write RAM
By default, Write stores the data switches at the address set on the address switches.
If you hold the Address Bus switch at 6502 while toggling Write, it stores the data switches at whatever address the 6502 is currently on.
-
4Enter and run at the same time
With the second method you can step the CPU and save the program in one pass. Toggle Step to move to the next address, set the data switches to the next byte, hold 6502 and toggle Write, then repeat.
If you make a mistake, reset and start over. Your progress so far is already in RAM.
-
5Toggle in the demo program
This program increments
$0300, loads it and stores it to$0301in a loop, so the data bus LEDs visibly count:$0200 EE 00 03 INC $0300 $0203 AD 00 03 LDA $0300 $0206 8D 01 03 STA $0301 $0209 4C 00 02 JMP $0200
You could save a couple of cycles, but that's hardly the point: this way you can clearly see the data bus blinking as it runs.
Anders Nielsen
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.