From 2f8589a5392c5a0f1f39b4d26cfaea452f28ef40 Mon Sep 17 00:00:00 2001 From: Zellyn Hunter Date: Sat, 17 Dec 2016 22:06:15 -0500 Subject: [PATCH] langcard: complete table-driven test structure --- audit/audit.dsk | Bin 143360 -> 143360 bytes audit/langcard.asm | 220 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+) diff --git a/audit/audit.dsk b/audit/audit.dsk index 56b2c1d63f2b850a924fcda92747475cd0e5c933..d10d1876615f9778ed0cc7eb0ebe10899e0fe2e9 100644 GIT binary patch delta 1994 zcmaJ=Z%A8L6u&PqF_n#Jbu_l!@^E97QkXCp!al6*%Q^^@ZrE=fwa*KpY=ku*3Nm6> z9J2KdX<)P;*4|nRebQGGQ&zRhc+cdik0vkI_q-=k$sAqb#BU_FE+8)AY8UGZ7_X=Y`&?{ez;Lon0r5VjRRr}j zY;(YWkyG7$b=1WkHjOv{xPv`u;T3&*3>W)tz*uDYfLOrcV@!i%5ywt5w>{wxs%m40 ztD^1@n&%&45mEjTe0BaYd}sM5SUfGk5)gkM^96j>%|FFgEBR+wSnjFpNAbTg7~;=O z+pG7nv3FqsAmjBOH$i|-yN#lS(B}&@*Ub7>`<(tuZIJkmZt(Lid&ZjpUk-4JV+cGk1(xHs(40%B@Dt1dtv*n2DNZztPf6L@xM1-fOje5=6nty-*t#rkB0eX@}TNpFgWf_A*O zgB#*OTI-4ZwXOzRfEU$TGB|ZpiM)L42 z=W5>DAIGBz{fI8aaW8%7XOM^NAC2P+2=&ru?GdN{HWm(ov;UX2@Ufc4&;Tx=jX#Eo zH6sTT10~)qW&YWAnXeb)^AhokjYLcIPrc_c>Op;uKNE{EiHpBYlTAL{2}(# zv0$k+`v#kK2q}1M^{sz03_HqqoM1s*$XmCgZYpheU~{gG(Gm*DOpNiVq)Y}9k&y^*zG|J#gQ_Kn^)7Fn%y7Ii zOO=GKB#B7~r#jfsW$vDmO3i6E5}EXnJS^vvsy=i#az#N2&I&q4^4c9OGoz95I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Keqj!~;CmNsE$1N}?2t@z)PSE+ZiVM6)K-z>kb{BiDRpIrsL<-rDU zJUhCI$hp48b4|R?eU#dM9Bl9)Jx|QJn}QAQMzH<(x}Dph%Cc$-cHC=B6 zBU_;4NkGSQcvSt3ao5a-V({sx!&!e*JhFlQtXHLFtF)Qkw4Yyf379aKedB}xJZrf^E=G+25v)`-aw7MRzPgz6}r5FH|I1p z`cs<0#`hZx-+U?=-;1) hp6V($1Q^}7rCc8vKX@$h93MQEXO*t+l`hg8{U4C9aMAz( diff --git a/audit/langcard.asm b/audit/langcard.asm index 6865c9a..3ce2465 100644 --- a/audit/langcard.asm +++ b/audit/langcard.asm @@ -208,6 +208,226 @@ +prerred .done5 jmp .done ++ + ;; Parameterized tests + + lda #<.tests + sta 0 + lda #>.tests + sta 1 +.outer + ;; Initialize to known state: + ;; - $55 in $D17B bank 1 (ROM: $53) + ;; - $AA in $D17B bank 2 (ROM: $53) + ;; - $55 in $FE1F (ROM: $60) + lda $C08B ; Read and write bank 1 + lda $C08B + lda #$55 + sta $D17B + sta $FE1F + lda $C083 ; Read and write bank 2 + lda $C083 + lda #$AA + sta $D17B + lda $C080 + + ldy #0 + +.inner + lda ($0),y + cmp #$ff + beq .test + tax + bmi + + lda $C080,x + jmp ++ ++ sta $C000,x +++ iny + bne .inner + +.test ;; ... test the triple + inc $D17B + inc $FE1F + iny + + ;; y now points to d17b-current,fe1f-current,bank1,bank2,fe1f-ram test quintiple + + ;; Test current $D17B + lda (0),y + cmp $D17B + beq + + lda $D17B + pha + jsr .printseq + +print + !text "$D17B TO CONTAIN $" + +printed + lda (0),y + jsr PRBYTE + +print + !text ", GOT $" + +printed + pla + jsr PRBYTE + lda #$8D + jsr COUT + jmp .done + ++ iny + ;; Test current $FE1F + lda (0),y + cmp $FE1F + beq + + lda $FE1F + pha + jsr .printseq + +print + !text "$FE1F=$" + +printed + lda (0),y + jsr PRBYTE + +print + !text ", GOT $" + +printed + pla + jsr PRBYTE + lda #$8D + jsr COUT + jmp .done + ++ iny + + ;; Test bank 1 $D17B + lda $C088 + lda (0),y + cmp $D17B + beq + + lda $D17B + pha + jsr .printseq + +print + !text "$D17B IN RAM BANK 1 TO CONTAIN $" + +printed + lda (0),y + jsr PRBYTE + +print + !text ", GOT $" + +printed + pla + jsr PRBYTE + lda #$8D + jsr COUT + jmp .done + ++ iny + + ;; Test bank 2 $D17B + lda $C080 + lda (0),y + cmp $D17B + beq + + lda $D17B + pha + jsr .printseq + +print + !text "$D17B IN RAM BANK 2 TO CONTAIN $" + +printed + lda (0),y + jsr PRBYTE + +print + !text ", GOT $" + +printed + pla + jsr PRBYTE + lda #$8D + jsr COUT + jmp .done + ++ iny + + ;; Test RAM $FE1F + lda $C080 + lda (0),y + cmp $FE1F + beq + + lda $FE1F + pha + jsr .printseq + +print + !text "RAM $FE1F=$" + +printed + lda (0),y + jsr PRBYTE + +print + !text ", GOT $" + +printed + pla + jsr PRBYTE + lda #$8D + jsr COUT + jmp .done + ++ iny + + lda ($0),y ; Done with the parameterized tests? + cmp #$ff + beq .over + clc + tya + adc $0 + sta $0 + bcc + + inc $1 ++ jmp .outer + +.tests + ;; Format: + ;; - $ff-terminated list of C0XX addresses (0-F to read C08X, 80-8F to write C0XX). + ;; - quint: expected current $d17b and fe1f, then d17b in bank1, d17b in bank 2, and fe1f + !byte $8, $ff ; Read $C088 (RAM read, write protected) + !byte $55, $55, $55, $AA, $55 + !byte $ff + + nop ; Provide clean break after data when viewing disassembly + nop + nop +.printseq + tya + pha + +print + !text "AFTER SEQUENCE OF:",$8D,"LDA $C080",$8D + +printed + ldy #$0 +- lda ($0),y + cmp #$ff + beq +++ + tax + bmi + + lda #'L' + jsr COUT + lda #'D' + bne ++ ++ lda #'S' + jsr COUT + lda #'T' +++ jsr COUT + +print + !text "A $C0" + +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 +.over ;; Success +print