From 3f0f77e57a7c92433d3c1ba25ee5fb464fa14b89 Mon Sep 17 00:00:00 2001 From: Zellyn Hunter Date: Wed, 14 Dec 2016 20:16:55 -0500 Subject: [PATCH] audit: split up asm files --- audit/audit.asm | 184 ++------------------------------------------- audit/audit.dsk | Bin 143360 -> 143360 bytes audit/detect.asm | 95 +++++++++++++++++++++++ audit/langcard.asm | 67 +++++++++++++++++ audit/macros.asm | 25 ++++++ audit/notes.org | 2 + 6 files changed, 196 insertions(+), 177 deletions(-) create mode 100644 audit/detect.asm create mode 100644 audit/langcard.asm create mode 100644 audit/macros.asm diff --git a/audit/audit.asm b/audit/audit.asm index d8cae28..ecfad7c 100644 --- a/audit/audit.asm +++ b/audit/audit.asm @@ -12,193 +12,23 @@ STRINGS = $7000 !set LASTSTRING = $7000 - !macro print { - lda #LASTSTRING - sta getch2+2 - jsr print2 - !set TEMP = * - * = LASTSTRING - } - !macro printed { - !byte 0 - !set LASTSTRING=* - * = TEMP - } - - !macro prerr NUM { - +print - } - !macro prerred { - !byte $8D - +printed - } + ;; Printing and error macros. + !src "macros.asm" + main: jsr HOME +print !text "APPLE II AUDIT",$8D,$8D +printed - !zone detect { - jsr IDENTIFY - lda $C082 ; Put ROM back in place. - +print - !text "MEMORY:" - +printed - lda MEMORY - bpl + - +print - !text "128K",$8D - +printed - beq +++ -+ cmp #64 - bcc + - +print - !text "64K",$8D - +printed - beq +++ -+ +print - !text "48K",$8D - +printed -+++ - lda MACHINE - bne .known - ;; MACHINE=0 - unknown machine - +prerr $0001 ;; E0001: The machine identification routines from http://www.1000bit.it/support/manuali/apple/technotes/misc/tn.misc.02.html failed to identify the model. - !text "UNABLE TO IDENTIFY" - +prerred - jmp end -.known - cmp #IIeCard - bcc .leiic - bne .gs -;IIeCard - +print - !text "IIE EMULATION CARD" - +printed - beq .notsupported -.gs ;PLUGH - +print - !text "APPLE IIGS" - +printed -.notsupported - +prerr $0002 ;; E0002: The current version of the audit program doesn't support the identified machine. - !text " NOT SUPPORTED" - +prerred - jmp end -.leiic - cmp #IIe - bcc .leiii - beq .iie -;IIc - +print - !text "IIC" - +printed - beq .notsupported -.iie - +print - !text "APPLE IIE" - +printed - lda ROMLEVEL - cmp #1 - beq + - +print - !text " (ENHANCED)" - +printed -+ lda #$8D - jsr COUT - beq .done -.leiii - cmp #IIplus - bcc .iiplain - beq .iiplus -;iiiem - +print - !text "APPLE III IN EMULATION MODE" - +printed - beq .notsupported -.iiplain - +print - !text "PLAIN APPLE II",$8D - +printed - beq .done -.iiplus - +print - !text "APPLE II PLUS",$8D - +printed -.done - } ;detect + ;; Detection and reporting of model and memory. + !src "detect.asm" - !zone langcard { - lda MEMORY - cmp #49 - bcs + - +print - !text "48K:SKIPPING LANGUAGE CARD TEST",$8D - +printed - beq .done2 - ;; Setup - store differing values in bank first and second banked areas. -+ lda $C08B ; Read and write First 4K bank - lda $C08B - lda #$55 - sta $D17B ; D17B is $53 in Apple II/plus/e/enhanced - cmp $D17B - beq + - +prerr $0003 ;; E0003: We tried to put the language card into read bank 1, write bank 1, but failed to write. - !text "CANNOT WRITE TO LC BANK 1 RAM" - +prerred - beq .done2 -+ sta $FE1F ; FE1F is $60 in Apple II/plus/e/enhanced - cmp $FE1F - beq + - +prerr $0004 ;; E0004: We tried to put the language card into read RAM, write RAM, but failed to write. - !text "CANNOT WRITE TO LC RAM" - +prerred - beq .done -+ lda $C083 ; Read and write Second 4K bank - lda $C083 - lda #$AA - sta $D17B - cmp $D17B - beq + - +prerr $0005 ;; E0005: We tried to put the language card into read bank 2, write bank 2, but failed to write. - !text "CANNOT WRITE TO LC BANK 2 RAM" - +prerred - beq .done -+ lda $C088 ; RAM read, bank 1 - lda $D17B - cmp #$55 - beq +++ - cmp #$AA - bne + - +prerr $0006 ;; E0006: Read $C088 (read bank 1), but the language card is still reading bank 2. - !text "$C088: BANK 1 ACTIVE" - +prerred -.done2 beq .done -+ cmp #$53 - bne + - +prerr $0007 ;; E0007: Read $C088 (read bank 1), but the language card is reading ROM. - !text "$C088: ROM ACTIVE" - +prerred - beq .done -+ +prerr $0007 ;; E0007: Read $C088 (read bank 1), but the check byte ($D17B) is an unknown value. - !text "$C088: UNKNOWN BYTE" - +prerred - beq .done -+++ - ;; Test - ;; Success - +print - !text "LANGUAGE CARD TESTS SUCCEEDED",$8D - +printed -.done - } ;langcard + ;; Language card tests. + !src "langcard.asm" end: jmp * - !src "technote2.asm" - print2 lda $C081 lda $C081 diff --git a/audit/audit.dsk b/audit/audit.dsk index d2e0c2621fc306cd8bedea952e5fbcadb6d53d84..4c0afd96460a9933a2a5855c14258cd95ac6e29a 100644 GIT binary patch delta 533 zcmYjOJ!n%=6u$SpnrH+06AKl2?G&846uWf0x^*qhxfwc$IJ)Iohz8nQ#0NqV zN-0#h#akksIuxFEF`5Tg?9eeohtNSDE+!3HPf~|m4(Fcpedi3{cl@^Nx7|jXW^R=A zYN*n3s-m9BdzHyzMPER0pFWuAf=Q|A5rXF`!4q1t@Y|wORu2x2>D+j*m(LHNV)|?e zG%=ASVy69&d)S>s_DFXcB}8l^=jo)VG0jBHS=MVI#y&A>PZINp7<20}Hj9JG-N0&| zM`cyQ6l8M?Gc7nIxfXf^1U^&W)OT-QXHq^jZoE|s#)WIWMiajKaxHeZ6KZJrJd sQog)E)7udhCW|8Q6ee|b1mmKRf&H_(9$t+MuVis=weYe)-xsXRKbQ^Yd;kCd delta 528 zcmYjOO-LI-6n>M&>f>yc7g&>9IFgY0?}VDP1T? zp@?8%z=1StkyO`=21;{S7}0~rPs`{dzB9px~4aO1&g6}&}aC)D+cOeTEvTjcRjPV)@`O%3#9 z43ePhG0*|P%cXuTA+2L@gw)5uI!3u}H#o#7Q#Lk0vByUACuZbjSDs8yjQ@M5IrBwc z$6K!QSv~W}RwVt3YrDAGzx!PQw7D$>A(Kz-XFR#g!y7xGS8W#Vg@;)|X#r zu}M?PJa1yz;KH-hqnmdOD?I~}%{~Ju%{7Id^#AV{;mxI=PF1i0@B!85IRWsdF%}Khi r;wcSOJfjE5mxVeE)F9RLw+!0EtpO^K^~wXA5FD;#D_Qb6o5=hJfC%rX diff --git a/audit/detect.asm b/audit/detect.asm new file mode 100644 index 0000000..a244163 --- /dev/null +++ b/audit/detect.asm @@ -0,0 +1,95 @@ +;;; Apple II Printing of model and memory +;;; Copyright © 2016 Zellyn Hunter + + !zone detect { + jsr IDENTIFY + lda $C082 ; Put ROM back in place. + + +print + !text "MEMORY:" + +printed + lda MEMORY + bpl + + +print + !text "128K",$8D + +printed + beq +++ ++ cmp #64 + bcc + + +print + !text "64K",$8D + +printed + beq +++ ++ +print + !text "48K",$8D + +printed ++++ + lda MACHINE + bne .known + ;; MACHINE=0 - unknown machine + +prerr $0001 ;; E0001: The machine identification routines from http://www.1000bit.it/support/manuali/apple/technotes/misc/tn.misc.02.html failed to identify the model. + !text "UNABLE TO IDENTIFY" + +prerred + jmp end +.known + cmp #IIeCard + bcc .leiic + bne .gs +;IIeCard + +print + !text "IIE EMULATION CARD" + +printed + beq .notsupported +.gs ;PLUGH + +print + !text "APPLE IIGS" + +printed +.notsupported + +prerr $0002 ;; E0002: The current version of the audit program doesn't support the identified machine. + !text " NOT SUPPORTED" + +prerred + jmp end +.leiic + cmp #IIe + bcc .leiii + beq .iie +;IIc + +print + !text "IIC" + +printed + beq .notsupported +.iie + +print + !text "APPLE IIE" + +printed + lda ROMLEVEL + cmp #1 + beq + + +print + !text " (ENHANCED)" + +printed ++ lda #$8D + jsr COUT + beq .done +.leiii + cmp #IIplus + bcc .iiplain + beq .iiplus +;iiiem + +print + !text "APPLE III IN EMULATION MODE" + +printed + beq .notsupported +.iiplain + +print + !text "PLAIN APPLE II",$8D + +printed + beq .done +.iiplus + +print + !text "APPLE II PLUS",$8D + +printed +.done + } ;detect + + !src "technote2.asm" diff --git a/audit/langcard.asm b/audit/langcard.asm new file mode 100644 index 0000000..32bef93 --- /dev/null +++ b/audit/langcard.asm @@ -0,0 +1,67 @@ +;;; Apple II Language Card audit routines +;;; Copyright © 2016 Zellyn Hunter + + !zone langcard { + lda MEMORY + cmp #49 + bcs + + +print + !text "48K:SKIPPING LANGUAGE CARD TEST",$8D + +printed + beq .done2 + ;; Setup - store differing values in bank first and second banked areas. ++ lda $C08B ; Read and write First 4K bank + lda $C08B + lda #$55 + sta $D17B ; D17B is $53 in Apple II/plus/e/enhanced + cmp $D17B + beq + + +prerr $0003 ;; E0003: We tried to put the language card into read bank 1, write bank 1, but failed to write. + !text "CANNOT WRITE TO LC BANK 1 RAM" + +prerred + beq .done2 ++ sta $FE1F ; FE1F is $60 in Apple II/plus/e/enhanced + cmp $FE1F + beq + + +prerr $0004 ;; E0004: We tried to put the language card into read RAM, write RAM, but failed to write. + !text "CANNOT WRITE TO LC RAM" + +prerred + beq .done ++ lda $C083 ; Read and write Second 4K bank + lda $C083 + lda #$AA + sta $D17B + cmp $D17B + beq + + +prerr $0005 ;; E0005: We tried to put the language card into read bank 2, write bank 2, but failed to write. + !text "CANNOT WRITE TO LC BANK 2 RAM" + +prerred + beq .done ++ lda $C088 ; RAM read, bank 1 + lda $D17B + cmp #$55 + beq +++ + cmp #$AA + bne + + +prerr $0006 ;; E0006: Read $C088 (read bank 1), but the language card is still reading bank 2. + !text "$C088: BANK 1 ACTIVE" + +prerred +.done2 beq .done ++ cmp #$53 + bne + + +prerr $0007 ;; E0007: Read $C088 (read bank 1), but the language card is reading ROM. + !text "$C088: ROM ACTIVE" + +prerred + beq .done ++ +prerr $0007 ;; E0007: Read $C088 (read bank 1), but the check byte ($D17B) is an unknown value. + !text "$C088: UNKNOWN BYTE" + +prerred + beq .done ++++ + ;; Test + ;; Success + +print + !text "LANGUAGE CARD TESTS SUCCEEDED",$8D + +printed +.done + } ;langcard diff --git a/audit/macros.asm b/audit/macros.asm new file mode 100644 index 0000000..e7f80df --- /dev/null +++ b/audit/macros.asm @@ -0,0 +1,25 @@ +;;; Apple II audit routine macros. +;;; Copyright © 2016 Zellyn Hunter + + !macro print { + lda #LASTSTRING + sta getch2+2 + jsr print2 + !set TEMP = * + * = LASTSTRING + } + !macro printed { + !byte 0 + !set LASTSTRING=* + * = TEMP + } + + !macro prerr NUM { + +print + } + !macro prerred { + !byte $8D + +printed + } diff --git a/audit/notes.org b/audit/notes.org index e05e427..b249b7e 100644 --- a/audit/notes.org +++ b/audit/notes.org @@ -21,3 +21,5 @@ D747 F0 D74B D7 D768 85 D76E 65 +* Links to things to test +** TODO [[https://groups.google.com/d/msg/comp.sys.apple2/RMnus8p6xp8/TDfD2HVtDwAJ][csa2: question on HGR behavior with enhanced 128K Apple //e]]