I am between meetings at the moment. Assuming BASIC4 (and a non-CRTC machine) - here is a simple test program:
Source:
Code:
ORG $E000 ; EDIT ROM for BASIC 4 (no CRTC).
LOOPY:
LDA #$00 ; Load A with 0
STA 0 ; Store A to address $0000
LDA 0 ; Load A from address $0000
LDA #$FF ; Load A with FF
STA 0 ; Store A to address $0000
LDA 0 ; Load A from address $0000
JMP LOOPY ; Keep repeating...
END ; End of test program.
Listing file:
Code:
E000 .ORG $E000 ; EDIT ROM for BASIC 4.
E000 LOOPY:
E000 A9 00 LDA #$00 ; Load A with 0
E002 85 00 STA 0 ; Store A to address $0000
E004 A5 00 LDA 0 ; Load A from address $0000
E006 A9 FF LDA #$FF ; Load A with FF
E008 85 00 STA 0 ; Store A to address $0000
E00A A5 00 LDA 0 ; Load A from address $0000
E00C 4C 00 E0 JMP LOOPY ; Keep repeating...
E00F END ; End of test program.
LOOPY: E000 DEFINED AT LINE 4
> USED AT LINE 12
Program the HEX bytes into a 2716 and put it in place of the EDIT ROM.
Incidentally, there is a very nice online assembler at asm80.com. Despite the name, it will assemble 6502 code! It will also produce a HEX (or BIN) file directly for loading into an EPROM programmer.
The test program first writes $00 to memory address $0000 and then reads memory address $0000 back again. It then repeats this with the value $FF - and keeps on doing this forever. You can change the data patterns it reads and writes by modifying the bytes at ROM offsets $0001 and $0007.
You should be able to look in much more detail at the RAM read and write cycles now (we are only playing with one address at $0000) and you should be able to see the exact data that is being read and written.
Might be worth waiting for dave_m to check my simple program first - he usually finds some fault or other with them
! Unless you want to take a flyer...
Dave
Bookmarks