2017-01-10 02:41:06 +00:00
|
|
|
;;; Apple IIe Auxiliary memory audit routines
|
|
|
|
;;; Copyright © 2017 Zellyn Hunter <zellyn@gmail.com>
|
|
|
|
|
|
|
|
!zone auxmem {
|
|
|
|
AUXMEMTESTS
|
2017-01-18 02:44:31 +00:00
|
|
|
lda #0
|
|
|
|
sta AUXRESULT
|
2017-01-10 02:41:06 +00:00
|
|
|
lda MEMORY
|
|
|
|
cmp #65
|
|
|
|
bcs +
|
|
|
|
+print
|
|
|
|
!text "64K OR LESS:SKIPPING AUXMEM TEST",$8D
|
|
|
|
+printed
|
2017-01-18 02:44:31 +00:00
|
|
|
sec
|
2017-01-10 02:41:06 +00:00
|
|
|
rts
|
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
+ +print
|
|
|
|
!text "TESTING AUX MEM",$8D
|
2017-01-10 02:41:06 +00:00
|
|
|
+printed
|
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
lda LCRESULT
|
|
|
|
bne .auxlc
|
2017-01-10 02:41:06 +00:00
|
|
|
+print
|
2017-01-18 02:44:31 +00:00
|
|
|
!text "LC FAILED BEFORE:SKIPPING AUXMEM LC",$8D
|
2017-01-10 02:41:06 +00:00
|
|
|
+printed
|
2017-01-18 02:44:31 +00:00
|
|
|
beq .skiplc
|
2017-01-10 02:41:06 +00:00
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
.auxlc ;; Run langcard tests in auxmem
|
2017-01-10 02:41:06 +00:00
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
lda LCRESULT
|
|
|
|
sta LCRESULT2
|
|
|
|
lda #0
|
|
|
|
sta LCRESULT
|
|
|
|
|
|
|
|
;; Store distinct values in RAM areas, to see if they stay safe.
|
|
|
|
lda $C08B ; Read and write bank 1
|
|
|
|
lda $C08B
|
|
|
|
lda #$44
|
|
|
|
sta $D17B ; $D17B is $53 in Apple II/plus/e/enhanced
|
|
|
|
lda #$55
|
|
|
|
sta $FE1F ; FE1F is $60 in Apple II/plus/e/enhanced
|
|
|
|
lda $C083 ; Read and write bank 2
|
|
|
|
lda $C083
|
|
|
|
lda #$66
|
|
|
|
sta $D17B
|
2017-01-10 02:41:06 +00:00
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
jsr .zptoaux
|
|
|
|
|
|
|
|
sta ALTZP_ON_W
|
|
|
|
jsr LANGCARDTESTS_NO_CHECK
|
|
|
|
sta ALTZP_OFF_W
|
2017-01-10 02:41:06 +00:00
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
jsr .zpfromaux
|
|
|
|
|
|
|
|
.skiplc
|
2017-01-10 02:41:06 +00:00
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
;; Success
|
2017-01-10 02:41:06 +00:00
|
|
|
+print
|
2017-01-18 02:44:31 +00:00
|
|
|
!text "AUXMEM TESTS SUCCEEDED",$8D
|
2017-01-10 02:41:06 +00:00
|
|
|
+printed
|
2017-01-18 02:44:31 +00:00
|
|
|
lda #1
|
|
|
|
sta AUXRESULT
|
|
|
|
clc
|
|
|
|
.done
|
|
|
|
rts
|
2017-01-10 02:41:06 +00:00
|
|
|
|
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
;;; Copy zero page to aux mem. Assumes zp pointing at main mem, and leaves it that way.
|
|
|
|
.zptoaux
|
|
|
|
ldx #0
|
|
|
|
- sta ALTZP_OFF_W
|
|
|
|
lda 0,x
|
|
|
|
sta ALTZP_ON_W
|
|
|
|
sta 0,x
|
|
|
|
inx
|
|
|
|
bne -
|
|
|
|
sta ALTZP_OFF_W
|
2017-01-10 02:41:06 +00:00
|
|
|
rts
|
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
;;; Copy zero page from aux mem. Assumes zp pointing at main mem, and leaves it that way.
|
|
|
|
.zpfromaux
|
|
|
|
ldx #0
|
|
|
|
- sta ALTZP_ON_W
|
|
|
|
lda 0,x
|
|
|
|
sta ALTZP_OFF_W
|
|
|
|
sta 0,x
|
|
|
|
inx
|
2017-01-10 02:41:06 +00:00
|
|
|
bne -
|
|
|
|
rts
|
|
|
|
|
2017-01-17 03:45:29 +00:00
|
|
|
} ;auxmem
|