;***********************************************************************
; MICROCOSM ASSOCIATES  8080/8085 CPU DIAGNOSTIC VERSION 1.0  (C) 1980
;***********************************************************************
;
;DONATED TO THE "SIG/M" CP/M USER'S GROUP BY:
;KELLY SMITH, MICROCOSM ASSOCIATES
;3055 WACO AVENUE
;SIMI VALLEY, CALIFORNIA, 93065
;(805) 527-9321 (MODEM, CP/M-NET (TM))
;(805) 527-0518 (VERBAL)
;
;***********************************************************************
; Modified 2001/02/28 by Richard Cini for use in the Altair32 Emulator
;	Project
;
; Need to somehow connect this code to Windows so that failure messages
;	can be posted to Windows. Maybe just store error code in
;	Mem[0xffff]. Maybe trap NOP in the emulator code?
;
;***********************************************************************

	.ORG $0	; start at bottom of RAM

;************************************************************
;                8080/8085 CPU TEST/DIAGNOSTIC
;************************************************************
;
;NOTE: (1) PROGRAM ASSUMES "CALL",AND "LXI SP" INSTRUCTIONS WORK!
;
;      (2) INSTRUCTIONS NOT TESTED ARE "HLT","DI","EI",
;          AND "RST 0" THRU "RST 7"
;
;
;
;TEST JUMP INSTRUCTIONS AND FLAGS
;
CPU:	LXI	SP,STACK	;SET THE STACK POINTER
	ANI	0	;INITIALIZE A REG. AND CLEAR ALL FLAGS
	JZ	J010	;TEST "JZ"
	CALL	CPUER
J010:	JNC	J020	;TEST "JNC"
	CALL	CPUER
J020:	JPE	J030	;TEST "JPE"
	CALL	CPUER
J030:	JP	J040	;TEST "JP"
	CALL	CPUER
J040:	JNZ	J050	;TEST "JNZ"
	JC	J050	;TEST "JC"
	JPO	J050	;TEST "JPO"
	JM	J050	;TEST "JM"
	JMP	J060	;TEST "JMP" (IT'S A LITTLE LATE,BUT WHAT THE HELL!
J050:	CALL	CPUER
J060:	ADI	6	;A=6,C=0,P=1,S=0,Z=0
	JNZ	J070	;TEST "JNZ"
	CALL	CPUER
J070:	JC	J080	;TEST "JC"
	JPO	J080	;TEST "JPO"
	JP	J090	;TEST "JP"
J080:	CALL	CPUER
J090:	ADI	$070	;A=76H,C=0,P=0,S=0,Z=0
	JPO	J100	;TEST "JPO"
	CALL	CPUER
J100:	JM	J110	;TEST "JM"
	JZ	J110	;TEST "JZ"
	JNC	J120	;TEST "JNC"
J110:	CALL	CPUER
J120:	ADI	$081	;A=F7H,C=0,P=0,S=1,Z=0
	JM	J130	;TEST "JM"
	CALL	CPUER
J130:	JZ	J140	;TEST "JZ"
	JC	J140	;TEST "JC"
	JPO	J150	;TEST "JPO"
J140:	CALL	CPUER
J150:	ADI	$0FE	;A=F5H,C=1,P=1,S=1,Z=0
	JC	J160	;TEST "JC"
	CALL	CPUER
J160:	JZ	J170	;TEST "JZ"
	JPO	J170	;TEST "JPO"
	JM	AIMM	;TEST "JM"
J170:	CALL	CPUER
;
;
;
;TEST ACCUMULATOR IMMEDIATE INSTRUCTIONS
;
AIMM:	CPI	0	;A=F5H,C=0,Z=0
	JC	CPIE	;TEST "CPI" FOR RE-SET CARRY
	JZ	CPIE	;TEST "CPI" FOR RE-SET ZERO
	CPI	$0F5	;A=F5H,C=0,Z=1
	JC	CPIE	;TEST "CPI" FOR RE-SET CARRY ("ADI")
	JNZ	CPIE	;TEST "CPI" FOR RE-SET ZERO
	CPI	$0FF	;A=F5H,C=1,Z=0
	JZ	CPIE	;TEST "CPI" FOR RE-SET ZERO
	JC	ACII	;TEST "CPI" FOR SET CARRY
CPIE:	CALL	CPUER
ACII:	ACI	$00A	;A=F5H+0AH+CARRY(1)=0,C=1
	ACI	$00A	;A=0+0AH+CARRY(0)=0BH,C=0
	CPI	$00B
	JZ	SUII	;TEST "ACI"
	CALL	CPUER
SUII:	SUI	$00C	;A=FFH,C=0
	SUI	$00F	;A=F0H,C=1
	CPI	$0F0
	JZ	SBII	;TEST "SUI"
	CALL	CPUER
SBII:	SBI	$0F1	;A=F0H-0F1H-CARRY(0)=FFH,C=1
	SBI	$00E	;A=FFH-OEH-CARRY(1)=F0H,C=0
	CPI	$0F0
	JZ	ANII	;TEST "SBI"
	CALL	CPUER
ANII:	ANI	$055	;A=F0H<AND>55H=50H,C=0,P=1,S=0,Z=0
	CPI	$050
	JZ	ORII	;TEST "ANI"
	CALL	CPUER
ORII:	ORI	$03A	;A=50H<OR>3AH=7AH,C=0,P=0,S=0,Z=0
	CPI	$07A
	JZ	XRII	;TEST "ORI"
	CALL	CPUER
XRII:	XRI	$00F	;A=7AH<XOR>0FH=75H,C=0,P=0,S=0,Z=0
	CPI	$075
	JZ	C010	;TEST "XRI"
	CALL	CPUER
;
;
;
;TEST CALLS AND RETURNS
;
C010:	ANI	$0	;A=0,C=0,P=1,S=0,Z=1
	CC	CPUER	;TEST "CC"
	CPO	CPUER	;TEST "CPO"
	CM	CPUER	;TEST "CM"
	CNZ	CPUER	;TEST "CNZ"
	CPI	$0
	JZ	C020	;A=0,C=0,P=0,S=0,Z=1
	CALL	CPUER
C020:	SUI	$077	;A=89H,C=1,P=0,S=1,Z=0
	CNC	CPUER	;TEST "CNC"
	CPE	CPUER	;TEST "CPE"
	CP	CPUER	;TEST "CP"
	CZ	CPUER	;TEST "CZ"
	CPI	$089
	JZ	C030	;TEST FOR "CALLS" TAKING BRANCH
	CALL	CPUER
C030:	ANI	$0FF	;SET FLAGS BACK!
	CPO	CPOI	;TEST "CPO"
	CPI	$0D9
	JZ	MOVI	;TEST "CALL" SEQUENCE SUCCESS
	CALL	CPUER
CPOI:	RPE		;TEST "RPE"
	ADI	$010	;A=99H,C=0,P=0,S=1,Z=0
	CPE	CPEI	;TEST "CPE"
	ADI	$002	;A=D9H,C=0,P=0,S=1,Z=0
	RPO		;TEST "RPO"
	CALL	CPUER
CPEI:	RPO		;TEST "RPO"
	ADI	$020	;A=B9H,C=0,P=0,S=1,Z=0
	CM	CMI	;TEST "CM"
	ADI	$004	;A=D7H,C=0,P=1,S=1,Z=0
	RPE		;TEST "RPE"
	CALL	CPUER
CMI:	RP		;TEST "RP"
	ADI	$080	;A=39H,C=1,P=1,S=0,Z=0
	CP	TCPI	;TEST "CP"
	ADI	$080	;A=D3H,C=0,P=0,S=1,Z=0
	RM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MVI	H,(TEMP0 / $0FF)
	MVI	L,(TEMP0 & $0FF)
	MOV	L,M
	MVI	A,(TEMP0 & $0FF)
	CMP	L
	CNZ	CPUER	;TEST "MOV" M,L AND L,M
	MVI	H,(TEMP0 / $0FF)
	MVI	L,(TEMP0 & $0FF)
	MVI	A,$032
	MOV	M,A
	CMP	M
	CNZ	CPUER	;TEST "MOV" M,A
	ADD	M
	CPI	$064
	CNZ	CPUER	;TEST "ADD" M
	XRA	A
	MOV	A,M
	CPI	$032
	CNZ	CPUER	;TEST "MOV" A,M
	MVI	H,(TEMP0 / $0FF)
	MVI	L,(TEMP0 & $0FF)
	MOV	A,M
	SUB	M
	CNZ	CPUER	;TEST "SUB" M
	MVI	A,$080
	ADD	A
	ADC	M
	CPI	$033
	CNZ	CPUER	;TEST "ADC" M
	MVI	A,$080
	ADD	A
	SBB	M
	CPI	$0CD
	CNZ	CPUER	;TEST "SBB" M
	ANA	M
	CNZ	CPUER	;TEST "ANA" M
	MVI	A,$025
	ORA	M
	CPI	$037
	CNZ	CPUER	;TEST "ORA" M
	XRA	M
	CPI	$005
	CNZ	CPUER	;TEST "XRA" M
	MVI	M,$055
	INR	M
	DCR	M
	ADD	M
	CPI	$05A
	CNZ	CPUER	;TEST "INR","DCR",AND "MVI" M
	LXI	B,$12FF
	LXI	D,$12FF
	LXI	H,$12FF
	INX	B
	INX	D
	INX	H
	MVI	A,$013
	CMP	B
	CNZ	CPUER	;TEST "LXI" AND "INX" B
	CMP	D
	CNZ	CPUER	;TEST "LXI" AND "INX" D
	CMP	H
	CNZ	CPUER	;TEST "LXI" AND "INX" H
	MVI	A,$0
	CMP	C
	CNZ	CPUER	;TEST "LXI" AND "INX" B
	CMP	E
	CNZ	CPUER	;TEST "LXI" AND "INX" D
	CMP	L
	CNZ	CPUER	;TEST "LXI" AND "INX" H
	DCX	B
	DCX	D
	DCX	H
	MVI	A,$012
	CMP	B
	CNZ	CPUER	;TEST "DCX" B
	CMP	D
	CNZ	CPUER	;TEST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	;TEST "DAD" D
	CMP	L
	CNZ	CPUER	;TEST "DAD" B
	STC
	CNC	CPUER	;TEST "STC"
	CMC
	CC	CPUER	;TEST "CMC
	MVI	A,$0AA
	CMA	
	CPI	$055
	CNZ	CPUER	;TEST "CMA"
	ORA	A	;RE-SET AUXILIARY CARRY
	DAA
	CPI	$055
	CNZ	CPUER	;TEST "DAA"
	MVI	A,$088
	ADD	A
	DAA
	CPI	$076
	CNZ	CPUER	;TEST "DAA"
	XRA	A
	MVI	A,$0AA
	DAA
	CNC	CPUER	;TEST "DAA"
	CPI	$010
	CNZ	CPUER	;TEST "DAA"
	XRA	A
	MVI	A,$09A
	DAA
	CNC	CPUER	;TEST "DAA"
	CNZ	CPUER	;TEST "DAA"
	STC
	MVI	A,$042
	RLC
	CC	CPUER	;TEST "RLC" FOR RE-SET CARRY
	RLC
	CNC	CPUER	;TEST "RLC" FOR SET CARRY
	CPI	$009
	CNZ	CPUER	;TEST "RLC" FOR ROTATION
	RRC
	CNC	CPUER	;TEST "RRC" FOR SET CARRY
	RRC
	CPI	$042
	CNZ	CPUER	;TEST "RRC" FOR ROTATION
	RAL
	RAL
	CNC	CPUER	;TEST "RAL" FOR SET CARRY
	CPI	$008
	CNZ	CPUER	;TEST "RAL" FOR ROTATION
	RAR
	RAR
	CC	CPUER	;TEST "RAR" FOR RE-SET CARRY
	CPI	$002
	CNZ	CPUER	;TEST "RAR" FOR ROTATION
	LXI	B,$01234
	LXI	D,$0AAAA
	LXI	H,$05555
	XRA	A
	PUSH	B
	PUSH	D
	PUSH	H
	PUSH	PSW
	LXI	B,$00000
	LXI	D,$00000
	LXI	H,$00000
	MVI	A,$0C0
	ADI	$0F0
	POP	PSW
	POP	H
	POP	D
	POP	B
	CC	CPUER	;TEST "PUSH PSW" AND "POP PSW"
	CNZ	CPUER	;TEST "PUSH PSW" AND "POP PSW"
	CPO	CPUER	;TEST "PUSH PSW" AND "POP PSW"
	CM	CPUER	;TEST "PUSH PSW" AND "POP PSW"
	MVI	A,$012
	CMP	B
	CNZ	CPUER	;TEST "PUSH B" AND "POP B"
	MVI	A,$034
	CMP	C
	CNZ	CPUER	;TEST "PUSH B" AND "POP B"
	MVI	A,$0AA
	CMP	D
	CNZ	CPUER	;TEST "PUSH D" AND "POP D"
	CMP	E
	CNZ	CPUER	;TEST "PUSH D" AND "POP D"
	MVI	A,$055
	CMP	H
	CNZ	CPUER	;TEST "PUSH H" AND "POP H"
	CMP	L
	CNZ	CPUER	;TEST "PUSH H" AND "POP H"
	LXI	H,$00000
	DAD	SP
	SHLD	SAVSTK	;SAVE THE "OLD" STACK-POINTER!
	LXI	SP,TEMP4
	DCX	SP
	DCX	SP
	INX	SP
	DCX	SP
	MVI	A,$055
	STA	TEMP2
	CMA
	STA	TEMP3
	POP	B
	CMP	B
	CNZ	CPUER	;TEST "LXI","DAD","INX",AND "DCX" SP
	CMA
	CMP	C
	CNZ	CPUER	;TEST "LXI","DAD","INX", AND "DCX" SP
	LXI	H,TEMP4
	SPHL
	LXI	H,$07733
	DCX	SP
	DCX	SP
	XTHL
	LDA	TEMP3
	CPI	$077
	CNZ	CPUER	;TEST "SPHL" AND "XTHL"
	LDA	TEMP2
	CPI	$033
	CNZ	CPUER	;TEST "SPHL" AND "XTHL"
	MVI	A,$055
	CMP	L
	CNZ	CPUER	;TEST "SPHL" AND "XTHL"
	CMA
	CMP	H
	CNZ	CPUER	;TEST "SPHL" AND "XTHL"
	LHLD	SAVSTK	;RESTORE THE "OLD" STACK-POINTER
	SPHL
	LXI	H,CPUOK
	PCHL		;TEST "PCHL"

CPUER:	mvi	a, $aa	; set exit code (failure)
	hlt		; STOP HERE

CPUOK:	mvi	a, $55	;
	hlt		; STOP HERE - no trap


; Data area
TEMPP:	.dw	TEMP0	;POINTER USED TO TEST "LHLD","SHLD",
			; AND "LDAX" INSTRUCTIONS
TEMP0:	.db	1	;TEMPORARY STORAGE FOR CPU TEST MEMORY LOCATIONS
TEMP1:	.db	1	;TEMPORARY STORAGE FOR CPU TEST MEMORY LOCATIONS
TEMP2:	.db	1	;TEMPORARY STORAGE FOR CPU TEST MEMORY LOCATIONS
TEMP3:	.db	1	;TEMPORARY STORAGE FOR CPU TEST MEMORY LOCATIONS
TEMP4:	.db	1	;TEMPORARY STORAGE FOR CPU TEST MEMORY LOCATIONS
SAVSTK:	.db	2	;TEMPORARY STACK-POINTER STORAGE LOCATION

STACK:	.dw	TEMPP + 256	;DE-BUG STACK POINTER STORAGE AREA
.end

