h47707
s 00024/00000/00000
d D 1.1 83/03/23 16:07:51 bog 1 0
c date and time created 83/03/23 16:07:51 by bog
e
u
4
U
t
T
I 1
;	Call GChrNW(Ch)
;		Output	Ch:	(^ in HL to) Int*2 ADE in [EMPTY,NUL..DEL]
; GChrNW get console char, no wait
; EMPTY (-1) returned if nothing there
	CSeg
	Public	GChrNW
GChrNW	Push	H		;Save ^ to Ch
	Mvi	C,6		;Direct console I/O
	Mvi	E,-1		;Input
	Call	5		;Invoke Direct consloe input BDOS call
	Mvi	E,0		;Assume got char -- high byte
	Ora	A		;Char received?
	Jnz	NotMT		;Jump if got char
 
	Dcr	A		;EMPTY is -1
	Dcr	E
 
NotMT	Pop	H		;Get ptr to Ch back
	Mov	M,A		;Stuff low byte
	Inx	H		;Point to high
	Mov	M,E		;Stuff high
	Ret			; & return
 
	End
E 1
