refactor(memtest): refactored the port of ROBIT-2

This commit is contained in:
2024-12-11 06:49:44 -06:00
parent f6642860a5
commit 3835594548

View File

@@ -73,29 +73,27 @@ OUTSTR
; RAM testing routine. Ported to 6809 from 6800, based on source for ROBIT-2 for ; RAM testing routine. Ported to 6809 from 6800, based on source for ROBIT-2 for
; MIKBUG. ; MIKBUG.
RAMTEST RAMTEST
ldx #SRAM_BASE ; Store 1 in memory ldx #SRAM_BASE
lda #1 1 ; Store 1 in memory
lda #1 ; Set [X] to 1
sta 0,x sta 0,x
cmpa 0,x cmpa 0,x ; If failed print out an error indicator
bne 1F bne 3F
1 ; Loop point for next 2 ; Loop point for next address
asla ; Shift A and [X] left asla ; Shift A and [X] left
asl 0,x asl 0,x
cmpa 0,x cmpa 0,x ; Compare A and [X]
bne 1F bne 3F
cmpa #$80 ; Only test up to $80 cmpa #$80 ; Only test up to $80
bne 1B bne 2B ; Loop if not $80
bra 2F cmpx #$60FF ; Compare X to end of RAM
1 ; Write out error indicator beq 4F ; Finish if we're at the end
leax 1,x ; Increment X
bra 1B
3 ; Write out error indicator
ldb #'X ldb #'X
jsr OUTCHAR jsr OUTCHAR
bra 3F ; Branch to finish 4 ; Pass test
2
cmpx #$60FF ; Compare X to end of RAM
beq 3F ; Finish if done, else try next address
leax 1,x
bra RAMTEST
3
ldb #'P ldb #'P
jsr OUTCHAR jsr OUTCHAR
rts rts