	title	Module from library BASE_6 : CHNIN
	name	('CHNIN')
	maclib	baselib.lib

; Get character from requested channel

; Copyright (C)	Werner Cirsovius
;		Hohe Weide 44
;		D-2000 Hamburg 20
;		Tel.: 040/4223247

;		Version 1.1 June 1987

; ENTRY	Register C holds channel number 0 .. max

; EXIT	Carry set indicates error channel out of range
;	or not opened - or end of file
;	On carry reset Accu holds character from file

	entry	chnin

	extrn	@chtst,chnxfr

chnin:
	call	@chtst		; Test channel in range
	ret	c
	scf
	jp	m,chnxfr	; Go read
	ret			; Error if write opened or random

	end

