Google
 

Trailing-Edge - PDP-10 Archives - tops10and20_integ_tools_v9_3-aug-86 - tools/crc/browse/ittinr.mac
There are no other files named ittinr.mac in the archive.
	title ittinr - returns char from terminal
;
;	This is a TOPS-20 version of ITTINR from RT11 SYSLIB.
;	If a character is available from the input buffer,
;	it is returned as ITTINR's value. If no character is available,
;	-1 is returned.
;	I=ITTINR(DUM)
;
	search	vtmac
	regdef
	entry	ittinr

ittinr:	push	p,t1
	push	p,t2		;save pertinent registers
	movei	t1,.priin	;point to primary input
	sibe%			;skip if input buffer empty
	 jrst	gotch		;we have a character, read it
	seto	0,		;no characters, return -1
	jrst	back		;go back
gotch:	pbin%			;read a character
	move	0,t1		;return in correct register
;	movei	t1,.priou	;get terminal
;	cfibf%			;clear input buffer
back:	pop	p,t2		;restore registers used
	pop	p,t1
	ret
	end