;
; SYSLIB Module Name:  SINITF
; Author:  Richard Conn
; SYSLIB Version Number:  2.0
; Module Version Number:  1.0
; Module Entry Points:
;	INITFCB
; Module External References:
;	FILLB
;

;
;  INITFCB -- GIVEN AN FCB PTED TO BY DE, INIT FCB FIELDS OTHER THAN FN
;	AND FT (FILE NAME AND FILE TYPE), TO ZERO; FCB MUST BE AT TOTAL OF
;	36 BYTES IN LENGTH (0=DR TO 35=R2)
;
;  ON RETURN, NO ERROR CODE RETURNED AND NO REGISTERS AFFECTED
;

	EXT	FILLB	; SYSLIB FILL ROUTINE (USE B REG)

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

INITFCB::
	PUTRG		; SAVE REGISTERS
	PUSH	PSW	; SAVE A
	XCHG		; HL PTS TO FCB
	XRA	A	; A=0
	MOV	M,A	; SET DR FIELD TO ZERO
	LXI	D,12	; PT TO EX FIELD
	DAD	D
	MVI	B,24	; CLEAR NEXT 24 BYTES
	CALL	FILLB	; USE SYSLIB ROUTINE
	POP	PSW	; GET A
	GETRG		; GET REGISTERS
	RET

	END
