;
; SYSLIB Module Name:  S0FILE
; Author:  Richard Conn
; SYSLIB Version Number:  2.0
; Module Version Number:  1.0
; Module Entry Points:
;	F0$GET		F0$PUT		FI0$CLOSE	FI0$OPEN
;	FO0$CLOSE	FO0$OPEN
; Module External References:
;	ADRCPY		F$GET		F$PUT		FI$CLOSE
;	FI$OPEN		FO$CLOSE	FO$OPEN
;

;
;  EXTERNAL DECLARATIONS
;
	EXT	ADRCPY
	EXT	FI$OPEN
	EXT	FO$OPEN
	EXT	FI$CLOSE
	EXT	FO$CLOSE
	EXT	F$GET
	EXT	F$PUT

;
;  MAIN ROUTINES FOR F0
;
FI0$OPEN::
	CALL	F0$COPY	; COPY ADDRESSES
	JMP	FI$OPEN	; DO IT
FO0$OPEN::
	CALL	F0$COPY	; COPY ADDRESSES
	JMP	FO$OPEN
F0$GET::
	CALL	F0$COPY	; COPY ADDRESSES
	JMP	F$GET
F0$PUT::
	CALL	F0$COPY	; COPY ADDRESSES
	JMP	F$PUT
FI0$CLOSE::
	CALL	F0$COPY	; COPY ADDRESSES
	JMP	FI$CLOSE
FO0$CLOSE::
	CALL	F0$COPY	; COPY ADDRESSES
	JMP	FO$CLOSE

F0$COPY:
	PUSH	H
	PUSH	D
	PUSH	B
	PUSH	PSW
	LXI	D,F0$TAB	; COPY F0
	CALL	ADRCPY
	POP	PSW
	POP	B
	POP	D
	POP	H
	RET

;
;  INIT TABLE AND BUFFERS FOR F0 ROUTINES
;
I0$FLG:	DB	0	; INPUT FILE OPENED FLAG (0=NO)
O0$FLG:	DB	0	; OUTPUT FILE OPENED FLAG (0=NO)
I0$FCB:	DS	36	; INPUT FILE FCB
O0$FCB:	DS	36	; OUTPUT FILE FCB
I0$BUF:	DS	128	; INPUT BUFFER
O0$BUF:	DS	128	; OUTPUT BUFFER
I0$PTR:	DS	2	; INPUT CHAR PTR
O0$PTR:	DS	2	; OUTPUT CHAR PTR
I0$CNT:	DS	1	; INPUT CHAR COUNT
O0$CNT:	DS	1	; OUTPUT CHAR COUNT

F0$TAB:
	DW	I0$FLG
	DW	O0$FLG
	DW	I0$FCB
	DW	O0$FCB
	DW	I0$BUF
	DW	O0$BUF
	DW	I0$PTR
	DW	O0$PTR
	DW	I0$CNT
	DW	O0$CNT

	END
