Compucolor.org – Virtual Media

Listing of file='KEYNUM.MAC;01' on disk='vmedia/comtronics-sector.ccvf'

; ASCII
;
; DISPLAY ASCII EQUIVALENTS
;
KBFLG	EQU	81DFH
INPCRT	EQU	81C5H
READY	EQU	81FFH
KBCHA	EQU	81FEH
LO	EQU	0033H
CRLF	EQU	17C1H
OSTR	EQU	182AH
;
START:	MVI	A,31
	STA	KBFLG
	MVI	A,0C3H
	STA	INPCRT
	LXI	H,KBINT
	SHLD	INPCRT+1
	XRA	A
	STA	READY
	STA	KBCHA
	LXI	H,LAST+100
	SPHL
;
START0:	LXI	H,MSG
	CALL	OSTR
	CALL	CRLF
	CALL	CRLF
START1:	CALL	CI
	MOV	B,A
	ANI	0F0H
	RAR
	RAR
	RAR
	RAR
	CPI	0AH
	JC	X1
	ADI	7
X1:	ADI	30H
	CALL	LO
	MOV	A,B
	ANI	0FH
	CPI	0AH
	JC	X2
	ADI	7
X2:	ADI	30H
	CALL	LO
	CALL	CRLF
	CALL	CRLF
	JMP	START1
;
CI:	EI
	LDA	CHARIN
	ANA	A
	JZ	CI
	PUSH	PSW
	XRA	A
	STA	READY
	STA	CHARIN
	POP	PSW
	RET
;
KBINT:	PUSH	H
	PUSH	PSW
	LXI	H,CHARIN
	XRA	A
	CMP	M
	JNZ	KBIN1
	MOV	A,E
	MOV	M,A
KBIN1:	POP	PSW
	POP	H
	EI
	RET
;
CHARIN:	DB	0
MSG:	DB	6,6,15,'FOR EACH KEY PRESSED, ITS ASCII VALUE IS DISPLAYED'
	DB	6,3,0EFH
;
LAST:
	END	START