Public feed
#892102
0001 0000 78 RAMTST: SEI ;disable interrupts so the monitor doesn't do anything
0002 0001 AD 83 C0 LDA $C083 ;write enable lang card RAM
0003 0004 AD 83 C0 LDA $C083
0004 0007 A9 00 LDA #$00 ;initialize registers
0005 0009 A2 00 LDX #$00
0006 000B 9D 00 E0 DEP: STA $E000,X ;store the contents of A into E000+X
0007 000E E8 INX ;increment X
0008 000F E0 FF CPX #$FF ;compare X to $FF
0009 0011 D0 F8 BNE DEP ;repeat process if X is not equal to $FF
0010 0013 A2 00 LDX #$00 ;begin initialization for verify phase
0011 0015 A9 00 RDR: LDA #$00 ;load $00 (expected value) into A
0012 0017 DD 00 E0 CMP $E000,X ;compare A with $E000+X
0013 001A D0 0A BNE ERR ;if comparison fails, jump to error "handler" (ha!)
0014 001C E8 INX ;increment X
0015 001D E0 FF CPX #$FF ;compare X to $FF
0016 001F D0 F4 BNE RDR ;repeat process if X isn't $FF
0017 0021 58 CLI ;enable interrupts so we can use the monitor again
0018 0022 AD 81 C0 LDA $C081 ;bank switch the ROM back in
0019 0025 60 RTS ;return to monitor or DOS
0020 0026 58 ERR: CLI ;enable interrupts
0021 0027 AD 81 C0 LDA $C081 ;switch back to ROM
0022 002A 20 2D FF JSR $FF2D ;call built in routine that beeps and flashes "ERR" on the display (indicates test failed)
0023 002D 60 RTS ;returns back to monitor/DOS
0024 002E .END
tasm: Number of errors = 0