diff --git a/README.md b/README.md index dcc9446..faeb34b 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ After starting up, most of the screen will be empty. * Each faulty memory access looks like this: `DEAD>BEEF`. * The part left of the `>` sign is the memory address at which the fault occured. * 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. + * If the delimiter is `X` instead of `>`, the byte that was written is the XOR of the high and low bytes of the address, i.e. `(DE xor AD)`. If you only see `X` 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. diff --git a/src/memtest6502.asm b/src/memtest6502.asm index b58a21c..0774af7 100644 --- a/src/memtest6502.asm +++ b/src/memtest6502.asm @@ -307,8 +307,13 @@ nowrap5a: sty scroff - ;; space + ;; address/value delimiter lda #">" + ldy pbyte + cpy #$42 + bne normaldelimiter + lda #"X" +normaldelimiter: ldy #$00 sta (scroff ;; upper nibble of pass char + lda pbyte + cmp #$42 + bne normalupper +special42upper: + lda aoff + eor >addr + lsr + lsr + lsr + lsr + tay + lda hexchars,Y + jmp upperendif +normalupper: lda ipass asl tay lda passchars,Y +upperendif: ldy #$00 sta (scroff ;; lower nibble of pass char + lda pbyte + cmp #$42 + bne normallower +special42lower: + lda aoff + eor >addr + and #$0f + tay + lda hexchars,Y + jmp lowerendif +normallower: lda ipass asl tay iny lda passchars,Y +lowerendif: ldy #$00 sta (