Compucolor.org – Virtual Media

Listing of file='RDFN.MAC;05' on disk='vmedia/asm_utility_routines-sideB-sector.ccvf'

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;	RDFN - READ A FILENAME
;
;	ON ENTRY (SAME AS FOR PFSPC):
;	   BC - POINTER TO DEFAULT FILE TYPE (STRING OF 3 CHRS)
;	   DE - POINTER TO FILE PARAMETER BLOCK (38 BYTES LONG)
;	   HL - POINTER TO INPUT BUFFER FOR FILENAME
;
;	RETURNS:
;	  <C> = ERROR
;
;	DESTROYS:
;	   ALL REGISTERS
;
;
;	FILE I/O ROUTINES - ADDRESSES MUST BE SET UP
;		PRIOR TO CALL TO THIS ROUTINE

	EXTRN	EMESS,PFSPC
;
;	REQD ROUTINES:
;
	EXTRN	OSTR,READ

;..............................................................
;
	ENTRY	RDFN

RDFN:	PUSH	H
	LXI	H,FILMSG	;DISPLAY PROMPT
	CALL	OSTR
	POP	H
	PUSH	H
	CALL	READ	;READ A LINE FROM CONSOLE
	POP	H
	CALL	PFSPC	;PARSE FILE SPEC
	JC	ERROR	;IF CARRY THEN ERROR

CHKEND:	MOV	A,M	;TEST FOR END
	MVI	B,9	;SETUP SYNTAX ERROR
	ORA	A
	RZ		;RETURN <NC>

ERROR:	CALL	EMESS	;EMIT ERROR MESSAGE
	STC		;<C> MEANS ERROR
	RET

;
;	FILENAME MESSAGE
;

FILMSG:	DB	13,10,11,6,3,'FILENAME> ',6,2,239

	END