home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
kaypro
/
kaydiag.lbr
/
BITCHK.MQC
/
BITCHK.MAC
Wrap
Text File
|
1986-11-29
|
3KB
|
209 lines
.Z80 ;ASSY FOR Z80
;THIS IS THE SOURCE CODE FOR BITCHK.
;WRITTEN BY LARRY KRAEMER 12/3/83
;
;TO SET UP FOR THIS PROGRAM FIRST CALL A MACRO TO CLEAR THE SCREEN
;THEN MOVE THE PROGRAM AND MESSAGES HIGH IN MEMORY. SELECT THE VIDEO
;PAGE, TURN OFF THE DRIVES, AND TURN OFF THE DRIVE LED'S. CLEAR THE
;SCREEN AGAIN AND START THE TEST BY PUTTING THE MESSAGES ON THE
;SCREEN OF THE TEST ADDRESS. THIS TEST WILL RUN UNTIL THE SYSTEM
;IS REBOOTED.
;
;THE BAD ADDRESS WILL BE TESTED IN A LOOP AND IF A BAD BIT IS FOUND
;THERE WILL BE AN X AT THAT LOCATION.
;
CR EQU 0DH
LF EQU 0AH
INIT EQU 4E00H
DEST EQU 5000H
START:
.XLIST
MACLIB CPMMAC
.LIST
VERSN '1.2'
IN A,(01CH)
SET 6,A
OUT (01CH),A
PRINT MES0
DELAY 11H,00H
PRINT MES1
LD BC,04H
LD HL,ADDR+4
AGN1: PUSH BC
PUSH HL
INPUT
POP HL
POP BC
LD (HL),A
INC HL
DEC BC
LD A,C
OR B
JR NZ,AGN1
LD HL,RAM
LD DE,INIT
LD BC,ERAM-RAA
LDIR
LD HL,ADDR+4
LD DE,6004H
LD BC,000AH
LDIR
LD HL,RAM1
LD DE,DEST
LD BC,ERAM1-RA
LDIR
LD HL,6004H
LD BC,0004H
B1: LD A,(HL)
CP 40H
JR NC,CON3
OR 20H
LD (HL),A
CON3: INC HL
DEC BC
LD A,B
OR C
JR NZ,B1
LD HL,6004H
LD BC,0004H
Z1: LD A,(HL)
CP 40H
JR C,D
AND 07H
ADD A,09H
JR HR
D: AND 0FH
HR: DEC HL
DEC HL
DEC HL
DEC HL
LD (HL),A
INC HL
INC HL
INC HL
INC HL
INC HL
DEC BC
LD A,B
OR C
JR NZ,Z1
LD A,(6000H)
RLCA
RLCA
RLCA
RLCA
LD HL,6001H
OR (HL)
LD (5015H),A
LD A,(6002H)
RLCA
RLCA
RLCA
RLCA
LD HL,6003H
OR (HL)
LD (5014H),A
JP INIT
RAM: .PHASE INIT
RAA: IN A,(01CH)
SET 7,A
SET 6,A
RES 0,A
RES 1,A
OUT (01CH),A
LD HL,3000H
LD DE,3001H
LD BC,0BFFH
LD (HL),20H
LDIR
LD HL,MSG1
LD DE,3419H
LD BC,1DH
LDIR
LD HL,MSG2
LD DE,351CH
LD BC,16H
LDIR
LD HL,MSG3
LD DE,361DH
LD BC,14H
LDIR
LD HL,6004H
LD DE,3724H
LD BC,0004H
LDIR
DELAY 04H,00H
JP DEST
MSG1: DEFM "KAYPRO II MEMORY TEST PROGRAM"
MSG2: DEFM "TESTING ALL EIGHT BITS"
MSG3: DEFM "OF SPECIFIED ADDRESS"
ERAM: DEFB 00H
.DEPHASE
.Z80
RAM1: .PHASE DEST
RA: LD B,08H
CALL VON
LD HL,3922H
AGN: LD (HL),2AH
INC HL
DJNZ AGN
CALL VOF
LD B,00H
MORE: DEC B
LD HL,7000H
LD A,B
LD (HL),A
XOR (HL)
JR NZ,MORE
PUSH BC
LD B,08H
LD HL,3922H
ROT: RLCA
JR C,ERROR
INC HL
DJNZ ROT
JR ANOTHR
ERROR: CALL VON
LD (HL),58H
INC HL
CALL VOF
DJNZ ROT
ANOTHR: LD HL,3922H
POP BC
JR MORE
VON: PUSH AF
IN A,(01CH)
SET 7,A
OUT (01CH),A
POP AF
RET
VOF: PUSH AF
IN A,(01CH)
RES 7,A
OUT (01CH),A
POP AF
RET
ERAM1: DEFB 00H
DEFB 00H
DEFB 00H
.DEPHASE
MES0: DEFB CR,LF,LF,LF,LF,LF,LF,LF,LF,LF
DEFB LF,LF,LF,LF,LF,LF,LF,LF,LF
DEFM " GREETINGS ! ! ! !"
DEFB LF,LF
DEFM " THIS DIAGNOSTIC PROGRAM IS FURNISHED BY LARRY KRAEMER"
DEFB CR,LF
DEFM " FOR ALL KAYPRO II OWNERS. "
DEFB LF,LF,LF,LF,LF,LF,LF
DEFB "$"
MES1: DEFB CR,LF,LF,LF,LF,LF,LF,LF,LF
DEFB LF,LF,LF,LF,LF,LF,LF,LF,LF
DEFM " INPUT THE HEX ADDRESS YOU WISH TO TEST WITH BITCHK "
DEFB CR,LF,LF,LF,LF,LF,LF,LF
DEFM "$"
ADDR: DEFB CR,LF
DEFS 4H
DEFB CR,LF
DEFM "$"
END START