;
; SYSLIB Module Name:  SRIN
; Author:  Richard Conn
; SYSLIB Version Number:  2.0
; Module Version Number:  1.0
; Module Entry Points:
;	RIN
; Module External References:
;	None
;

;
;  RIN -- 
;	READER INPUT ROUTINE
;	INPUT CHARACTER FROM RDR: INTO REG A
;	AFFECT ONLY REG A AND FLAGS
;	
PUTRG	MACRO
	PUSH	B	; SAVE BC, DE, HL
	PUSH	D
	PUSH	H
	ENDM
GETRG	MACRO
	POP	H	; RESTORE HL, DE, BC
	POP	D
	POP	B
	ENDM

RIN::
	PUTRG		; SAVE REGISTERS
	LHLD	JTABL	; GET ADDRESS OF JUMP TABLE
	MVI	L,R$OFF	; READER INPUT ADR
	LXI	D,RRET1	; SET UP RET ADR
	PUSH	D	; ... ON STACK
	PCHL
RRET1:	GETRG		; RESTORE REGISTERS
	RET

BOOT	EQU	0	; CP/M BOOT ADDRESS
JTABL	EQU	BOOT+1	; CP/M JUMP TABLE ADDRESS
R$OFF	EQU	15H	; READER INPUT OFFSET

	END
