audit: convert langcard tests to executable style

This commit is contained in:
Zellyn Hunter 2017-04-24 21:06:55 -04:00
parent b98edea9a0
commit dda6de609e
5 changed files with 181 additions and 168 deletions

View File

@ -193,6 +193,7 @@ end:
!src "monitor-routines.asm" !src "monitor-routines.asm"
!src "keyboard.asm" !src "keyboard.asm"
!src "video.asm" !src "video.asm"
!src "printtest.asm"
;!src "shasumtests.asm" ;!src "shasumtests.asm"
print print

Binary file not shown.

View File

@ -24,8 +24,8 @@
.region = tmp4 .region = tmp4
.actual = tmp1 .actual = tmp1
.desired = tmp2 .desired = tmp2
AUXMEMTESTS AUXMEMTESTS
lda #0 lda #0
sta AUXRESULT sta AUXRESULT
@ -55,7 +55,7 @@ AUXMEMTESTS
sta LCRESULT1 sta LCRESULT1
lda #0 lda #0
sta LCRESULT sta LCRESULT
;; Store distinct values in RAM areas, to see if they stay safe. ;; Store distinct values in RAM areas, to see if they stay safe.
lda $C08B ; Read and write bank 1 lda $C08B ; Read and write bank 1
lda $C08B lda $C08B
@ -68,7 +68,7 @@ AUXMEMTESTS
sta $D17B sta $D17B
jsr zptoaux jsr zptoaux
sta SET_ALTZP sta SET_ALTZP
jsr LANGCARDTESTS_NO_CHECK jsr LANGCARDTESTS_NO_CHECK
sta RESET_ALTZP sta RESET_ALTZP
@ -83,7 +83,7 @@ AUXMEMTESTS
+prerred +prerred
sec sec
rts rts
;; Check that the stuff we stashed in main RAM was unaffected. ;; Check that the stuff we stashed in main RAM was unaffected.
+ +
lda $C088 ; Read bank 1 lda $C088 ; Read bank 1
@ -147,7 +147,7 @@ AUXMEMTESTS
lda #>.auxtests lda #>.auxtests
sta PCH sta PCH
;;; Main data-drive-test loop. ;;; Main data-drive-test loop.
.ddloop .ddloop
ldy #0 ldy #0
lda (PCL),Y lda (PCL),Y
beq .success beq .success
@ -171,7 +171,7 @@ AUXMEMTESTS
sta RESET_ALTZP sta RESET_ALTZP
sta RESET_RAMWRT sta RESET_RAMWRT
sta RESET_RAMRD sta RESET_RAMRD
sec sec
sbc #2 sbc #2
bcs .initloop bcs .initloop
@ -205,7 +205,7 @@ AUXMEMTESTS
sta .checkdata+1 sta .checkdata+1
;; First checkdata byte is for Cxxx tests. ;; First checkdata byte is for Cxxx tests.
jsr .nextcheck jsr NEXTCHECK
bmi + bmi +
jsr .checkCxxx jsr .checkCxxx
@ -214,11 +214,11 @@ AUXMEMTESTS
jsr RESETALL jsr RESETALL
stx .checkdata stx .checkdata
sty .checkdata+1 sty .checkdata+1
;; Do the next part twice. ;; Do the next part twice.
lda #1 lda #1
sta .ismain sta .ismain
jsr .nextcheck jsr NEXTCHECK
.checkloop ; Loop twice here: once for main, once for aux. .checkloop ; Loop twice here: once for main, once for aux.
lda #4 lda #4
sta .region sta .region
@ -241,7 +241,7 @@ AUXMEMTESTS
beq .memlp beq .memlp
.memlpinc .memlpinc
jsr .nextcheck jsr NEXTCHECK
dec .region ; loop four times: zero, main, text, hires dec .region ; loop four times: zero, main, text, hires
bne .memlp bne .memlp
@ -257,7 +257,7 @@ AUXMEMTESTS
sty .checkdata+1 sty .checkdata+1
sta .ismain sta .ismain
jmp .checkloop jmp .checkloop
.checkdone .checkdone
;; Jump PCL,PCH to next test, and loop. ;; Jump PCL,PCH to next test, and loop.
ldx .checkdata ldx .checkdata
@ -285,7 +285,7 @@ AUXMEMTESTS
;; X = index of memory location ;; X = index of memory location
;; A = actual ;; A = actual
;; Y = desired | (high bit set if main, unset=aux) ;; Y = desired | (high bit set if main, unset=aux)
jsr RESETALL jsr RESETALL
sta .actual sta .actual
@ -330,10 +330,10 @@ AUXMEMTESTS
+prerr $000A ;; E000A: This is a data-driven test of main and auxiliary memory softswitch operation. We initialize $FF, $100, $200, $3FF, $427, $7FF, $800, $1FFF, $2000, $3FFF, $4000, $5FFF, and $BFFF in main RAM to value 1, and in auxiliary RAM to value 3. Then, we perform a testdata-driven sequence of instructions. Finally we (try to) increment all test locations. Then we test the expected values of the test locations in main and auxiliary memory. For more information on the operation of the auxiliary memory soft-switches, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-22 to 5-28. +prerr $000A ;; E000A: This is a data-driven test of main and auxiliary memory softswitch operation. We initialize $FF, $100, $200, $3FF, $427, $7FF, $800, $1FFF, $2000, $3FFF, $4000, $5FFF, and $BFFF in main RAM to value 1, and in auxiliary RAM to value 3. Then, we perform a testdata-driven sequence of instructions. Finally we (try to) increment all test locations. Then we test the expected values of the test locations in main and auxiliary memory. For more information on the operation of the auxiliary memory soft-switches, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-22 to 5-28.
!text "FOLLOWED BY INC OF TEST LOCATIONS. SEE" !text "FOLLOWED BY INC OF TEST LOCATIONS. SEE"
+prerred +prerred
sec sec
rts rts
;;; Check that the expected ROM areas are visible. ;;; Check that the expected ROM areas are visible.
.checkCxxx .checkCxxx
.gotCxxx = tmp0 .gotCxxx = tmp0
@ -367,7 +367,7 @@ AUXMEMTESTS
+printed +printed
lda .gotCxxx lda .gotCxxx
jsr .printCxxxBits jsr .printCxxxBits
+prerr $000B ;; E000B: This is a the Cxxx-ROM check part of the auxiliary memory data-driven test (see E000A for a description of the other part). After a full reset, we perform a testdata-driven sequence of instructions. Finally we check which parts of Cxxx ROM seem to be visible. We check C100-C2FF, C300-C3FF, C400-C7FF (which should be the same as C100-C2FF), and C800-CFFE. For more details, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-28. +prerr $000B ;; E000B: This is a the Cxxx-ROM check part of the auxiliary memory data-driven test (see E000A for a description of the other part). After a full reset, we perform a testdata-driven sequence of instructions. Finally we check which parts of Cxxx ROM seem to be visible. We check C100-C2FF, C300-C3FF, C400-C7FF (which should be the same as C100-C2FF), and C800-CFFE. For more details, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-28.
!text "CXXX ROM TEST FAILED" !text "CXXX ROM TEST FAILED"
+prerred +prerred
@ -377,7 +377,7 @@ AUXMEMTESTS
pla pla
sec sec
rts rts
.checkCxxxDone .checkCxxxDone
rts rts
@ -462,47 +462,14 @@ AUXMEMTESTS
!text "ROM",$8D !text "ROM",$8D
+printed +printed
rts rts
;;; Increment .checkdata pointer to the next memory location, and load
;;; it into the accumulator. X and Y are preserved.
.nextcheck
inc .checkdata
bne +
inc .checkdata+1
+ sty SCRATCH
ldy #0
lda (.checkdata),y
ldy SCRATCH
ora #0
rts
;;; Print out the sequence of instructions at PCL,PCH, until we hit a JSR. ;;; Print out the sequence of instructions at PCL,PCH, until we hit a JSR.
.printtest .printtest
+print +print
!text "AFTER SEQUENCE",$8D !text "AFTER SEQUENCE",$8D
+printed +printed
- jmp PRINTTEST
ldy #0
lda (PCL),y
cmp #$20
beq +++
lda #'-'
jsr COUT
lda #' '
jsr COUT
ldx #0
lda (PCL,x)
jsr $f88e
ldx #3
jsr $f8ea
jsr $f953
sta PCL
sty PCH
lda #$8D
jsr COUT
jmp -
+++ rts
;;; Copy zero page to aux mem. Assumes zp pointing at main mem, and leaves it that way. ;;; Copy zero page to aux mem. Assumes zp pointing at main mem, and leaves it that way.
zptoaux zptoaux
ldx #0 ldx #0
@ -529,7 +496,7 @@ zpfromaux
.auxtests .auxtests
;; Our four basic tests -------------------------------------- ;; Our four basic tests --------------------------------------
;; Test 1: everything reset. ;; Test 1: everything reset.
lda #1 lda #1
jsr .check jsr .check
@ -546,7 +513,7 @@ zpfromaux
sta SET_RAMRD sta SET_RAMRD
jsr .check jsr .check
!byte .C_skip, 2, 4, 4, 4, 3, 3, 3, 3 !byte .C_skip, 2, 4, 4, 4, 3, 3, 3, 3
;; Test 4: write to AUX, read from AUX, everything else normal. ;; Test 4: write to AUX, read from AUX, everything else normal.
lda #4 lda #4
sta SET_RAMRD sta SET_RAMRD
@ -556,7 +523,7 @@ zpfromaux
;; Our four basic tests, but with 80STORE ON ----------------- ;; Our four basic tests, but with 80STORE ON -----------------
;; (400-7ff is pointing at main mem) ;; (400-7ff is pointing at main mem)
;; Test 5: everything reset. ;; Test 5: everything reset.
lda #5 lda #5
sta SET_80STORE sta SET_80STORE
@ -576,7 +543,7 @@ zpfromaux
sta SET_80STORE sta SET_80STORE
jsr .check jsr .check
!byte .C_skip, 2, 4, 2, 4, 3, 3, 3, 3 !byte .C_skip, 2, 4, 2, 4, 3, 3, 3, 3
;; Test 8: read and write aux ;; Test 8: read and write aux
lda #8 lda #8
sta SET_RAMRD sta SET_RAMRD
@ -587,7 +554,7 @@ zpfromaux
;; Our four basic tests, but with 80STORE and PAGE2 ON ------- ;; Our four basic tests, but with 80STORE and PAGE2 ON -------
;; (400-7ff is pointing at aux mem) ;; (400-7ff is pointing at aux mem)
;; Test 9: everything reset. ;; Test 9: everything reset.
lda #9 lda #9
sta SET_80STORE sta SET_80STORE
@ -610,7 +577,7 @@ zpfromaux
sta SET_PAGE2 sta SET_PAGE2
jsr .check jsr .check
!byte .C_skip, 2, 4, 1, 4, 3, 3, 4, 3 !byte .C_skip, 2, 4, 1, 4, 3, 3, 4, 3
;; Test C: read and write aux ;; Test C: read and write aux
lda #$c lda #$c
sta SET_RAMRD sta SET_RAMRD
@ -622,7 +589,7 @@ zpfromaux
;; Our four basic tests, but with 80STORE and HIRES ON ------- ;; Our four basic tests, but with 80STORE and HIRES ON -------
;; (400-7ff and 2000-3fff are pointing at main mem) ;; (400-7ff and 2000-3fff are pointing at main mem)
;; Test D: everything reset. ;; Test D: everything reset.
lda #$d lda #$d
sta SET_80STORE sta SET_80STORE
@ -645,7 +612,7 @@ zpfromaux
sta SET_HIRES sta SET_HIRES
jsr .check jsr .check
!byte .C_skip, 2, 4, 2, 2, 3, 3, 3, 3 !byte .C_skip, 2, 4, 2, 2, 3, 3, 3, 3
;; Test 10: read and write aux ;; Test 10: read and write aux
lda #$10 lda #$10
sta SET_RAMRD sta SET_RAMRD
@ -683,7 +650,7 @@ zpfromaux
sta SET_PAGE2 sta SET_PAGE2
jsr .check jsr .check
!byte .C_skip, 2, 4, 1, 1, 3, 3, 4, 4 !byte .C_skip, 2, 4, 1, 1, 3, 3, 4, 4
;; Test 14: read and write aux ;; Test 14: read and write aux
lda #$14 lda #$14
sta SET_RAMRD sta SET_RAMRD

View File

@ -1,7 +1,9 @@
;;; Apple II Language Card audit routines ;;; Apple II Language Card audit routines
;;; Copyright © 2016 Zellyn Hunter <zellyn@gmail.com> ;;; Copyright © 2016 Zellyn Hunter <zellyn@gmail.com>
!zone langcard { !zone langcard {
.checkdata = tmp1
LANGCARDTESTS LANGCARDTESTS
lda #0 lda #0
sta LCRESULT sta LCRESULT
@ -61,20 +63,25 @@ LANGCARDTESTS_NO_CHECK:
+ lda $C081 ; Read ROM with single access (only one needed to bank out) + lda $C081 ; Read ROM with single access (only one needed to bank out)
lda #$53 lda #$53
cmp $D17B cmp $D17B
beq .dotest beq .datadriventests
+prerr $000E ;; E000E: We tried to put the language card into read ROM, but failed to read. +prerr $000E ;; E000E: We tried to put the language card into read ROM, but failed to read.
!text "CANNOT READ FROM ROM" !text "CANNOT READ FROM ROM"
+prerred +prerred
sec sec
rts rts
;; Parameterized tests ;;; Main data-driven test. PCL,PCH holds the address of the next
;;; data-driven test routine. We expect the various softswitches
.dotest lda #<.tests ;;; to be reset each time we loop at .ddloop.
sta 0 .datadriventests
lda #<.tests
sta PCL
lda #>.tests lda #>.tests
sta 1 sta PCH
.outer ;;; Main data-drive-test loop.
.ddloop
ldy #0
;; Initialize to known state: ;; Initialize to known state:
;; - $11 in $D17B bank 1 (ROM: $53) ;; - $11 in $D17B bank 1 (ROM: $53)
;; - $22 in $D17B bank 2 (ROM: $53) ;; - $22 in $D17B bank 2 (ROM: $53)
@ -91,32 +98,25 @@ LANGCARDTESTS_NO_CHECK:
sta $D17B sta $D17B
lda $C080 lda $C080
ldy #0 jmp (PCL) ; Jump to test routine
.inner
lda ($0),y
cmp #$ff
beq .test
tax
bmi +
ora #$80
sta .lda+1
.lda lda $C000
jmp ++
+ sta .sta+1
.sta sta $C000
++ iny
bne .inner
.test ;; ... test the triple ;; Test routine will JSR back to here, so the check data address is on the stack.
.test ;; ... test the quintiple of test values
inc $D17B inc $D17B
inc $FE1F inc $FE1F
iny
;; y now points to d17b-current,fe1f-current,bank1,bank2,fe1f-ram test quintiple ;; pull address off of stack: it points just below check data for this test.
pla
sta .checkdata
pla
sta .checkdata+1
;; .checkdata now points to d17b-current,fe1f-current,bank1,bank2,fe1f-ram test quintiple
;; Test current $D17B ;; Test current $D17B
lda (0),y jsr NEXTCHECK
cmp $D17B cmp $D17B
beq + beq +
lda $D17B lda $D17B
@ -125,7 +125,7 @@ LANGCARDTESTS_NO_CHECK:
+print +print
!text "$D17B TO CONTAIN $" !text "$D17B TO CONTAIN $"
+printed +printed
lda (0),y jsr CURCHECK
jsr PRBYTE jsr PRBYTE
+print +print
!text ", GOT $" !text ", GOT $"
@ -136,9 +136,8 @@ LANGCARDTESTS_NO_CHECK:
jsr COUT jsr COUT
jmp .datatesturl jmp .datatesturl
+ iny + ;; Test current $FE1F
;; Test current $FE1F jsr NEXTCHECK
lda (0),y
cmp $FE1F cmp $FE1F
beq + beq +
lda $FE1F lda $FE1F
@ -147,7 +146,7 @@ LANGCARDTESTS_NO_CHECK:
+print +print
!text "$FE1F=$" !text "$FE1F=$"
+printed +printed
lda (0),y jsr CURCHECK
jsr PRBYTE jsr PRBYTE
+print +print
!text ", GOT $" !text ", GOT $"
@ -158,11 +157,9 @@ LANGCARDTESTS_NO_CHECK:
jsr COUT jsr COUT
jmp .datatesturl jmp .datatesturl
+ iny + ;; Test bank 1 $D17B
;; Test bank 1 $D17B
lda $C088 lda $C088
lda (0),y jsr NEXTCHECK
cmp $D17B cmp $D17B
beq + beq +
lda $D17B lda $D17B
@ -171,7 +168,7 @@ LANGCARDTESTS_NO_CHECK:
+print +print
!text "$D17B IN RAM BANK 1 TO CONTAIN $" !text "$D17B IN RAM BANK 1 TO CONTAIN $"
+printed +printed
lda (0),y jsr CURCHECK
jsr PRBYTE jsr PRBYTE
+print +print
!text ", GOT $" !text ", GOT $"
@ -182,11 +179,9 @@ LANGCARDTESTS_NO_CHECK:
jsr COUT jsr COUT
jmp .datatesturl jmp .datatesturl
+ iny + ;; Test bank 2 $D17B
;; Test bank 2 $D17B
lda $C080 lda $C080
lda (0),y jsr NEXTCHECK
cmp $D17B cmp $D17B
beq + beq +
lda $D17B lda $D17B
@ -195,7 +190,7 @@ LANGCARDTESTS_NO_CHECK:
+print +print
!text "$D17B IN RAM BANK 2 TO CONTAIN $" !text "$D17B IN RAM BANK 2 TO CONTAIN $"
+printed +printed
lda (0),y jsr CURCHECK
jsr PRBYTE jsr PRBYTE
+print +print
!text ", GOT $" !text ", GOT $"
@ -206,11 +201,9 @@ LANGCARDTESTS_NO_CHECK:
jsr COUT jsr COUT
jmp .datatesturl jmp .datatesturl
+ iny + ;; Test RAM $FE1F
;; Test RAM $FE1F
lda $C080 lda $C080
lda (0),y jsr NEXTCHECK
cmp $FE1F cmp $FE1F
beq + beq +
lda $FE1F lda $FE1F
@ -219,7 +212,7 @@ LANGCARDTESTS_NO_CHECK:
+print +print
!text "RAM $FE1F=$" !text "RAM $FE1F=$"
+printed +printed
lda (0),y jsr CURCHECK
jsr PRBYTE jsr PRBYTE
+print +print
!text ", GOT $" !text ", GOT $"
@ -230,19 +223,15 @@ LANGCARDTESTS_NO_CHECK:
jsr COUT jsr COUT
jmp .datatesturl jmp .datatesturl
+ iny + ;; Jump PCL,PCH up to after the test data, and loop.
jsr NEXTCHECK
lda ($0),y ; Done with the parameterized tests?
cmp #$ff
bne + bne +
jmp .over jmp .success
+ clc + ldx .checkdata
tya ldy .checkdata+1
adc $0 stx PCL
sta $0 sty PCH
bcc + jmp .ddloop
inc $1
+ jmp .outer
.datatesturl .datatesturl
+prerr $0007 ;; E0007: This is a data-driven test of Language Card operation. We initialize $D17B in RAM bank 1 to $11, $D17B in RAM bank 2 to $22, and $FE1F in RAM to $33. Then, we perform a testdata-driven sequence of LDA and STA to the $C08X range. Finally we (try to) increment $D17B and $FE1F. Then we test (a) the current live value in $D17B, (b) the current live value in $FE1F, (c) the RAM bank 1 value of $D17B, (d) the RAM bank 2 value of $D17B, and (e) the RAM value of $FE1F, to see whether they match expected values. $D17B is usually $53 in ROM, and $FE1F is usally $60. For more information on the operation of the language card soft-switches, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-24. +prerr $0007 ;; E0007: This is a data-driven test of Language Card operation. We initialize $D17B in RAM bank 1 to $11, $D17B in RAM bank 2 to $22, and $FE1F in RAM to $33. Then, we perform a testdata-driven sequence of LDA and STA to the $C08X range. Finally we (try to) increment $D17B and $FE1F. Then we test (a) the current live value in $D17B, (b) the current live value in $FE1F, (c) the RAM bank 1 value of $D17B, (d) the RAM bank 2 value of $D17B, and (e) the RAM value of $FE1F, to see whether they match expected values. $D17B is usually $53 in ROM, and $FE1F is usally $60. For more information on the operation of the language card soft-switches, see Understanding the Apple IIe, by James Fielding Sather, Pg 5-24.
@ -252,79 +241,90 @@ LANGCARDTESTS_NO_CHECK:
rts rts
.printseq .printseq
tya
pha
+print +print
!text "AFTER SEQUENCE OF:",$8D,"LDA $C080",$8D !text "AFTER SEQUENCE OF:",$8D,"- LDA $C080",$8D
+printed +printed
ldy #$0 jsr PRINTTEST
- lda ($0),y
cmp #$ff
beq +++
tax
bmi +
lda #'L'
jsr COUT
lda #'D'
bne ++
+ lda #'S'
jsr COUT
lda #'T'
++ jsr COUT
+print +print
!text "A $C0" !text "- INC $D17B",$8D,"- INC $FE1F",$8D,"EXPECTED "
+printed +printed
txa
ora #$80
jsr PRBYTE
lda #$8D
jsr COUT
iny
bne -
+++
+print
!text "INC $D17B",$8D,"INC $FE1F",$8D,"EXPECTED "
+printed
pla
tay
rts rts
.tests .tests
;; Format: ;; Format:
;; - $ff-terminated list of C0XX addresses (0-F to read C08X, 80-8F to write C0XX). ;; Sequence of test instructions, finishing with `jsr .test`.
;; - quint: expected current $d17b and fe1f, then d17b in bank1, d17b in bank 2, and fe1f ;; - quint: expected current $d17b and fe1f, then d17b in bank1, d17b in bank 2, and fe1f
;; (All sequences start with lda $C080, just to reset things to a known state.) ;; (All sequences start with lda $C080, just to reset things to a known state.)
!byte $08, $ff ; Read $C088 (RAM read, write protected) ;; 0-byte to terminate tests.
lda $C088 ; Read $C088 (RAM read, write protected)
jsr .test ;
!byte $11, $33, $11, $22, $33 ; !byte $11, $33, $11, $22, $33 ;
!byte $00, $ff ; Read $C080 (read bank 2, write disabled) ;
lda $C080 ; Read $C080 (read bank 2, write disabled)
jsr .test ;
!byte $22, $33, $11, $22, $33 ; !byte $22, $33, $11, $22, $33 ;
!byte $01, $ff ; Read $C081 (ROM read, write disabled) ;
lda $C081 ; Read $C081 (ROM read, write disabled)
jsr .test ;
!byte $53, $60, $11, $22, $33 ; !byte $53, $60, $11, $22, $33 ;
!byte $01, $09, $ff ; Read $C081, $C089 (ROM read, bank 1 write) ;
lda $C081 ; Read $C081, $C089 (ROM read, bank 1 write)
lda $C089 ;
jsr .test ;
!byte $53, $60, $54, $22, $61 ; !byte $53, $60, $54, $22, $61 ;
!byte $01, $01, $ff ; Read $C081, $C081 (read ROM, write RAM bank 2) ;
lda $C081 ; Read $C081, $C081 (read ROM, write RAM bank 2)
lda $C081 ;
jsr .test ;
!byte $53, $60, $11, $54, $61 ; !byte $53, $60, $11, $54, $61 ;
!byte $01, $01, $81, $ff ; Read $C081, $C081, write $C081 (read ROM, write RAM bank bank 2) ;
lda $C081 ; Read $C081, $C081, write $C081 (read ROM, write RAM bank bank 2)
lda $C081 ;
sta $C081 ;
jsr .test ;
!byte $53, $60, $11, $54, $61 ; See https://github.com/zellyn/a2audit/issues/3 !byte $53, $60, $11, $54, $61 ; See https://github.com/zellyn/a2audit/issues/3
!byte $0b, $ff ; Read $C08B (read RAM bank 1, no write) ;
lda $C08B ; Read $C08B (read RAM bank 1, no write)
jsr .test ;
!byte $11, $33, $11, $22, $33 ; !byte $11, $33, $11, $22, $33 ;
!byte $03, $ff ; Read $C083 (read RAM bank 2, no write) ;
lda $C083 ; Read $C083 (read RAM bank 2, no write)
jsr .test ;
!byte $22, $33, $11, $22, $33 ; !byte $22, $33, $11, $22, $33 ;
!byte $0b, $0b, $ff ; Read $C08B, $C08B (read/write RAM bank 1) ;
lda $C08B ; Read $C08B, $C08B (read/write RAM bank 1)
lda $C08B ;
jsr .test ;
!byte $12, $34, $12, $22, $34 ; !byte $12, $34, $12, $22, $34 ;
!byte $0f, $07, $ff ; Read $C08F, $C087 (read/write RAM bank 2) ;
lda $C08F ; Read $C08F, $C087 (read/write RAM bank 2)
lda $C087 ;
jsr .test ;
!byte $23, $34, $11, $23, $34 ; !byte $23, $34, $11, $23, $34 ;
!byte $07, $0D, $ff ; Read $C087, read $C08D (read ROM, write bank 1) ;
lda $C087 ; Read $C087, read $C08D (read ROM, write bank 1)
lda $C08D ;
jsr .test ;
!byte $53, $60, $54, $22, $61 ; !byte $53, $60, $54, $22, $61 ;
!byte $0b, $8b, $0b, $ff ; Read $C08B, write $C08B, read $C08B (read RAM bank 1, no write) ;
!byte $11, $33, $11, $22, $33 ; (this one is tricky: reset WRTCOUNT by writing halfway) lda $C08B ; Read $C08B, write $C08B, read $C08B (read RAM bank 1, no write)
!byte $8b, $8b, $0b, $ff ; Write $C08B, write $C08B (read RAM bank 1, no write) sta $C08B ; (this one is tricky: reset WRTCOUNT by writing halfway)
lda $C08B ;
jsr .test ;
!byte $11, $33, $11, $22, $33 ; !byte $11, $33, $11, $22, $33 ;
!byte $ff ;
sta $C08B ; Write $C08B, write $C08B, read $C08B (read RAM bank 1, no write)
sta $C08B ;
lda $C08B ;
jsr .test ;
!byte $11, $33, $11, $22, $33 ;
;
!byte 0
nop ; Provide clean break after data when viewing disassembly nop ; Provide clean break after data when viewing disassembly
nop nop
.over .success
;; Success ;; Success
+print +print

45
audit/printtest.asm Normal file
View File

@ -0,0 +1,45 @@
;;; Helper routines for printing out sequences of test code.
;;; Copyright © 2017 Zellyn Hunter <zellyn@gmail.com>
!zone printtest {
.checkdata = tmp1
PRINTTEST
-
ldy #0
lda (PCL),y
cmp #$20
beq +++
lda #'-'
jsr COUT
lda #' '
jsr COUT
ldx #0
lda (PCL,x)
jsr $f88e
ldx #3
jsr $f8ea
jsr $f953
sta PCL
sty PCH
lda #$8D
jsr COUT
jmp -
+++ rts
;;; Increment .checkdata pointer to the next memory location, and load
;;; it into the accumulator. X and Y are preserved.
NEXTCHECK
inc .checkdata
bne CURCHECK
inc .checkdata+1
CURCHECK
sty SCRATCH
ldy #0
lda (.checkdata),y
ldy SCRATCH
ora #0
rts
} ;printtest