[Coco] 64k test
Robert Gault
robert.gault at att.net
Wed Jul 19 08:56:09 EDT 2017
Here is a more specific test of 64k memory. If you want to test it on a Coco1 without a disk system,
you will need to compile it to tape and may need to change the origin.
Robert
* 64K Core memory test by Robert Gault
* This is designed to test most of the 64K memory of a Coco1 OR 2.
PRINT EQU $B99C ROM ROUTINE Prints a string
NUMBR EQU $BDCC ROM ROUTINE Prints an integer
RAM EQU $FFDF
ROM EQU $FFDE
CLOSE EQU $A416
ORG $E00
START JSR CLOSE
CLRA
STA $FF40
STA $71
STA ROM
ORCC #$50 Turn off interrupts
LEAX MSG1-1,PCR
JSR PRINT
LEAY MEMTBL,PCR Test for 4K, 16K, 32K
CLRB
A@ LDX ,Y++ get an address
INCB
STB AMNT2,PCR
LDA ,X get the byte
COM ,X Change what might be ROM
CMPA ,X did it change?
BNE A@ Go if RAM
LEAX -1,X
STX ADDR,PCR
CMPX #$7FFF
BNE TSTING less than 32K RAM
STA RAM
LDA $A000
COM $A000
CMPA $A000
BEQ TSTING 32K RAM
INC AMNT2,PCR
LDX #$FF00
STX ADDR,PCR
JSR TMPVAL
STA RAM
BRA TST2
TSTING JSR TMPVAL
TST2 LDX #$0 Test from $0000-$0DFF
LEAY TABLE,PCR
A@ LDA ,X
LDB #3
STA TMP,PCR
B@ LDA B,Y
STA ,X
LDA ,X
CMPA B,Y
BNE ERR
DECB
BPL B@
LDA TMP,PCR
STA ,X+
CMPX #$E00
BNE A@
LDX #$F00 Test from $0F00-$FEFF or less
A@ LDA ,X
LDB #3
STA TMP,PCR
B@ LDA B,Y
STA ,X
LDA ,X
CMPA B,Y
BNE ERR
DECB
BPL B@
LDA TMP
STA ,X+
CMPX ADDR Limit for testing
BNE A@
BRA OK
TMPVAL STA ROM Just 32K RAM so go back to ROM
LEAX MSG2-1,PCR
JSR PRINT
LEAX AMNT-1,PCR
LDA #5
LDB AMNT2
MUL
LEAX D,X
JMP PRINT
ERR STA ROM
STX LOC
LEAX ERRMSG-1,PCR
JSR PRINT
LDD LOC,PCR
JSR NUMBR
BRA EXIT
OK STA ROM
LEAX OKMSG-1,PCR
JSR PRINT
EXIT JSR $ADFB
ANDCC #$AF
JMP $A027
ADDR RMB 2
TMP RMB 1
LOC RMB 2
TOGL FCB 0 *Used to return to correct RAM/ROM mode
MEMTBL FDB $1000,$4000,$8000
TABLE FCB 0,$FF,%10101010,%01010101
MSG2 FCC /YOU SEEM TO HAVE/
FCB $0D,0
AMNT2 FCB 0
AMNT RMB 5
FCC /04K/ *3
FCB $0D,0 *2
FCC /16K/
FCB $0D,0
FCC /32K/
FCB $0D,0
FCC /64K/
FCB $0D,0
MSG1 FCC /TESTING MEMORY/
FCB $0D,0
ERRMSG FCC /AN ERROR OCCURED AT /
FCB 0
OKMSG FCC /NO ERRORS IN MEMORY/
FCB $0D,0
ORG $16A
JMP START
END START
More information about the Coco
mailing list