	.TITLE	PREAL
/
/  14 MAR 77 - PAUL HENDERSON
/
/  ROUTINE TO ALLOW A USER TO PRE-ALLOCATE BUFFERS FOR DISK I/O.
/  THIS IS MAINLY USEFUL WHEN CALLING 'DSPLAY' BEFORE PERFORMING
/  ANY DISK I/O.  'PREAL' SHOULD BE CALLED ONCE FOR EACH LUN EXPECTED
/  TO HAVE AN OPEN DISK FILE DURING THE EXECUTION OF THE TASK.
/
/  CALLING SEQUENCE:
/
/	CALL PREAL (LUN)
/
/  NORMAL ASSEMBLY IS FOR WATRAN.  TO ASSEMBLE FOR DEC FORTRAN,
/
F4=1		/ MUST BE DEFINED.
/
	.GLOBL	PREAL
/
	.IFUND	F4
	.GLOBL	.ARG
	.ENDC
	.IFDEF	F4
	.GLOBL	.DA
.ARG=.DA
	.ENDC
/
PREAL	XX
	JMS*	.ARG
	JMP	.+3
LUN
IEV
	LAC*	LUN
	DAC	PRECPB+2	/ INSERT REQUESTED LUN INTO CPB
	LAC	IEV
	DAC	PRECPB+1	/ PUT EV ADDRESS IN PREAL CPB
	DAC	WTFOR+1		/ AND IN WAITFOR CPB.
	CAL	PRECPB		/ DO THE PREALLOCATION
	LAC	IEV
	DZM	IEV		/ ZERO IT IN CASE NOT NEEDED NEXT TIME
	SZA
	CAL	WTFOR		/ WAIT ONLY IF EV ADDRESS SUPPLIED
	JMP*	PREAL		/ RETURN TO CALLER
/
PRECPB	2300;	0; 0
WTFOR	20;	0
	.END
