|
@@ -23,21 +23,21 @@
|
|
|
|
|
|
memtest_init:
|
|
|
xor a
|
|
|
- ld e,a ; reset error accumulator
|
|
|
+ ld e,a ; reset error accumulator
|
|
|
ret
|
|
|
|
|
|
memtest_absent:
|
|
|
ld b,h
|
|
|
ld c,1
|
|
|
- cpl ; A := FF
|
|
|
- .redo ld (hl),a ; write FF to base
|
|
|
- cpl ; A := 0
|
|
|
+ cpl ; A := FF
|
|
|
+ .redo ld (hl),a ; write FF to base
|
|
|
+ cpl ; A := 0
|
|
|
ld (bc),a ; write 00 to base+1
|
|
|
cp (hl) ; compare to base (should be FF, should not match)
|
|
|
jr z,.allbad ; if they match, all bits are bad, but double-check
|
|
|
- cp 0 ; are we on the first round?
|
|
|
+ cp 0 ; are we on the first round?
|
|
|
jr z,.redo ; yes, redo with reversed bits
|
|
|
- ret ; didn't find missing ram, exit without error
|
|
|
+ ret ; didn't find missing ram, exit without error
|
|
|
.allbad:
|
|
|
ld e,$FF ; report all bits bad
|
|
|
ret
|
|
@@ -55,14 +55,14 @@ memtest_march_w_up:
|
|
|
memtest_march_rw_up:
|
|
|
.loop:
|
|
|
ld a,(hl)
|
|
|
- cp d ; compare to value
|
|
|
+ cp d ; compare to value
|
|
|
jr z, .cont ; memory changed, report
|
|
|
- xor d ; calculate errored bits
|
|
|
+ xor d ; calculate errored bits
|
|
|
or e
|
|
|
- ld e,a ; save error bits to e
|
|
|
- ld a,d ; reload a with correct value
|
|
|
+ ld e,a ; save error bits to e
|
|
|
+ ld a,d ; reload a with correct value
|
|
|
.cont:
|
|
|
- cpl ; take the complement
|
|
|
+ cpl ; take the complement
|
|
|
ld (hl),a ; write the complement
|
|
|
inc hl
|
|
|
dec bc
|
|
@@ -76,14 +76,14 @@ memtest_march_rw_dn:
|
|
|
dec hl
|
|
|
.loop:
|
|
|
ld a,(hl)
|
|
|
- cp d ; compare to value
|
|
|
+ cp d ; compare to value
|
|
|
jr z, .cont
|
|
|
- xor d ; calculate errored bits
|
|
|
+ xor d ; calculate errored bits
|
|
|
or e
|
|
|
- ld e,a ; save error bits to e
|
|
|
- ld a,d ; reload a with correct value
|
|
|
+ ld e,a ; save error bits to e
|
|
|
+ ld a,d ; reload a with correct value
|
|
|
.cont:
|
|
|
- cpl ; take the complement
|
|
|
+ cpl ; take the complement
|
|
|
ld (hl),a ; write complement
|
|
|
dec hl
|
|
|
dec bc
|
|
@@ -99,10 +99,10 @@ memtest_march_r_dn:
|
|
|
ld a,(hl)
|
|
|
cp d
|
|
|
jr z,.cont
|
|
|
- xor d ; calculate errored bits
|
|
|
+ xor d ; calculate errored bits
|
|
|
or e
|
|
|
- ld e,a ; save error bits to e
|
|
|
- ld a,d ; reload a with correct value
|
|
|
+ ld e,a ; save error bits to e
|
|
|
+ ld a,d ; reload a with correct value
|
|
|
.cont:
|
|
|
dec hl
|
|
|
dec bc
|
|
@@ -114,12 +114,12 @@ memtest_march_r_dn:
|
|
|
|
|
|
mtmredo:
|
|
|
ld a,d
|
|
|
- cp 0 ; if our test value is 0
|
|
|
+ cp 0 ; if our test value is 0
|
|
|
ld d,$55
|
|
|
- jr z,mtm1_bounce ; then rerun the tests with value $55
|
|
|
+ jr z,mtm1_bounce ; then rerun the tests with value $55
|
|
|
|
|
|
mtm_done:
|
|
|
- sub a ; set carry flag if e is nonzero
|
|
|
+ sub a ; set carry flag if e is nonzero
|
|
|
or e
|
|
|
mtm_return:
|
|
|
ret z
|
|
@@ -128,7 +128,7 @@ memtest_march_r_dn:
|
|
|
|
|
|
memtest_march:
|
|
|
xor a
|
|
|
- ld e,a ; reset error accumulator
|
|
|
+ ld e,a ; reset error accumulator
|
|
|
|
|
|
push hl ; save the test regs
|
|
|
push bc
|