diff --git a/README.md b/README.md index b7e3348..04ad220 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,9 @@ After starting up, most of the screen will be empty. * The part right of the `>` sign is two bytes: First the byte that was written to this address, then the byte that was returned when reading from the same address. * If the written byte reads `XX` instead of a hex byte, the byte that was actually written is the XOR of the high and low bytes of the address, i.e. `(DE xor AD)`. If you only see `XX` faults, there may be a fault in the address lines, rather than individual memory cells or output lines. * In the bottom right you can see 3 quickly alternating characters. The first two chars are the textual (PETSCII characters, not hexdumped) representation of the memory address currently being tested. The third char is the character written to said memory address in the current pass. + * When all memtest passes have completed, there will be an additional `=` character left of these chars. + * When the memtest routine was interrupted by an NMI, there will be a `!` instead. +* When the screen is not cleared (filled with random characters), and the first line starts with `ZF***ZF` (`*` being other seemingly random characters), a fault in the first few bytes of the zero page were detected. Since the memtest uses this area to store its state, the test is terminated prematurely. ``` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ diff --git a/memtest-f000.901465.asm b/memtest-f000.901465.asm index 257595e..d49572b 100644 --- a/memtest-f000.901465.asm +++ b/memtest-f000.901465.asm @@ -26,6 +26,56 @@ main: sei + ;; test the first few bytes of memory with $FF + ldy #$00 + lda #$ff +zeroloopFF: + sta $00,Y + cmp $00,Y + beq zerookFF + ldx #"Z" + stx scrptr + ldx #"F" + stx scrptr+1 + sty scrptr+2 + sta scrptr+3 + lda $00,Y + sta scrptr+3 + ldx #"Z" + stx scrptr+4 + ldx #"F" + stx scrptr+5 + jmp done +zerookFF: + iny + cpy #$10 + bne zeroloopFF + + ;; test the first few bytes of memory with $00 + ldy #$00 + lda #$00 +zeroloop00: + sta $00,Y + cmp $00,Y + beq zerook00 + ldx #"Z" + stx scrptr + ldx #"F" + stx scrptr+1 + sty scrptr+2 + sta scrptr+3 + lda $00,Y + sta scrptr+3 + ldx #"Z" + stx scrptr+4 + ldx #"F" + stx scrptr+5 + jmp done +zerook00: + iny + cpy #$10 + bne zeroloop00 + ;; clear screen ldx #done ; NMIV + .byt nmiv ; NMIV .byt main ; RESV .byt main ; IRQV