	.ENABLE GLOBAL
	.ENABLE SUBSTITUTION
	;
	;	Building Virtual Disk Driver and utilities
	;
	.SETF SRCDEV
	.IFNDF $TKB .SETS $TKB "TKB"
	.IFDF $SRC .GOTO SRCOK
	.SETS $SRC COMMAN
	.PARSE $SRC " " $SRC DUMMY
	.PARSE $SRC "/" $SRC DUMMY
	.PARSE $SRC "." $SRC EXT
	.IF EXT EQ "" .SETS EXT "CMD"
	.TESTFILE '$SRC'.'EXT'
	.PARSE <FILSPC> ":" $SRC TEMP
	.TESTFILE SY:
	.PARSE <FILSPC> ":" SYDEV TEMP
	.IF $SRC EQ SYDEV .SETT SRCDEV
	.SETS $SRC $SRC+":"
.SRCOK:	.SETF Q
	.IFDF $LST .AND .IFDF $MP .GOTO CHKMP
	.ASK Q Generate listings
	.IFT Q .SETS $LST ""
	.IFF Q .SETS $LST "NL:"
	.SETF Q
	.ASK Q Generate maps
	.IFT Q .SETS $MP ""
	.IFF Q .SETS $MP "NL:"
.CHKMP:	.IFNDF $VDUN .ASKN [1.:63.] $VDUN How many virtual disk units do you want
	.OPEN VDPRE.MAC
	.DATA 	.NLIST
	.DATA 	.TITLE	VD     - VIRTUAL DISK PREFIX FILE
	.DATA ;
	.DATA ;	GET UCB OFFSETS.
	.DATA ;
	.DATA 	.MCALL	UCBDF$		;DEFINE UCB OFFSETS
	.DATA 	UCBDF$
	.DATA ;
	.DATA ; DEFINE ADDITIONAL UCB OFFSET.
	.DATA ;
	.DATA U.NXT	= U.VCB+2		;EXTENSION BLOCK ADDRESS
	.DATA U.QIO	= U.NXT+2		;QIO COUNT OFFSET (2 WORDS)
	.DATA ;
	.DATA ; DEFINE EXTENSION BLOCK OFFSETS.
	.DATA ;
	.DATA X.OFF	= 0			;DISK FILE OFFSETS
	.DATA X.UCB	= X.OFF+4		;NEXT UCB ADDRESS
	.DATA X.FLG	= X.UCB+2		;EXTENSION FLAGS
	.DATA X.FNB	= X.FLG+2		;FILENAME BLOCK
	.DATA X.LGTH	= X.FNB+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5,'$MP'AVD/-SP=AVD,LB:[1,54]RSX11M.STB/SS
	.DATA /
	.DATA UNITS=3
	.DATA ASG=TI:2
	.DATA ASG=SY:3
	.DATA TASK=...AVD
	.DATA PRI=100
	.DATA PAR=GEN
	.DATA /
	.CLOSE
	'$TKB' @AVDBLD
	PIP AVDBLD.CMD;*/DE
	PIP AVD.OBJ;*/DE
	.OPEN DVDBLD.CMD
	.DATA DVD/MM/CP/-FP/PR:5,'$MP'DVD/-SP=DVD,LB:[1,54]RSX11M.STB/SS
	.DATA /
	.DATA UNITS=3
	.DATA ASG=TI:2
	.DATA ASG=SY:3
	.DATA TASK=...DVD
	.DATA PRI=100
	.DATA PAR=GEN
	.DATA /
	.CLOSE
	'$TKB' @DVDBLD
	PIP DVDBLD.CMD;*/DE
	PIP DVD.OBJ;*/DE
	.OPEN VDCBLD.CMD
	.DATA VDC/MM/CP/-FP/PR:5,'$MP'VDC/-SP=VDC,LB:[1,54]RSX11M.STB/SS
	.DATA /
	.DATA UNITS=3
	.DATA ASG=TI:2
	.DATA ASG=SY:3
	.DATA TASK=...VDC
	.DATA PRI=100
	.DATA PAR=GEN
	.DATA /
	.CLOSE
	'$TKB' @VDCBLD
	PIP VDCBLD.CMD;*/DE
	PIP VDC.OBJ;*/DE
	.OPEN VDABLD.CMD
	.DATA VDA/PR/CP,'$MP'VDA/-SP=VDA,TTIO
	.DATA LB:[1,54]RSX11M.STB/SS
	.DATA /
	.DATA PRI=100
	.DATA TASK=...VDA
	.DATA STACK=40
	.DATA //
	.CLOSE
	'$TKB' @VDABLD
	PIP VDABLD.CMD;*/DE,VDA.OBJ;*,TTIO.OBJ;*
	.OPEN VDQIOBLD.CMD
	.DATA VDQIO/PR/CP,'$MP'VDQIO/-SP=VDQIO
	.DATA LB:[1,54]RSX11M.STB/SS
	.DATA /
	.DATA PRI=100
	.DATA TASK=VDQIO
	.DATA STACK=40
	.DATA //
	.CLOSE
	TKB @VDQIOBLD
	PIP VDQIOBLD.CMD;*/DE,VDQIO.OBJ;*
	.OPEN VDRPTBLD.CMD
	.DATA VDRPT/CP,'$MP'VDRPT/-SP=VDRPT
	.DATA /
	.DATA PRI=50
	.DATA TASK=...VDR
	.DATA UNITS=3
	.DATA STACK=100
	.DATA ASG=SY:1
	.DATA ASG=SY:2
	.DATA ASG=TI:3
	.DATA //
	.CLOSE
	TKB @VDRPTBLD
	PIP VDRPTBLD.CMD;*/DE,VDRPT.OBJ;*
	.OPEN VDQBLD.CMD
	.DATA VDQ/PR/CP,'$MP'VDQ/-SP=VDQ
	.DATA LB:[1,54]RSX11M.STB/SS
	.DATA /
	.DATA PRI=100
	.DATA TASK=...VDQ
	.DATA STACK=40
	.DATA //
	.CLOSE
	TKB @VDQBLD
	PIP VDQBLD.CMD;*/DE,VDQ.OBJ;*
	.OPEN VDDRVBLD.CMD
	.DATA VDDRV/-HD/-MM,'$MP'VDDRV/-SP,SY0:VDDRV=VDDRV,VDTBL
	.DATA LB:[1,54]RSX11M.STB/SS
	.DATA /
	.DATA STACK=0
	.DATA PAR=DRVPAR:120000:14000
	.DATA /
	.CLOSE
	'$TKB' @VDDRVBLD
	PIP VDDRVBLD.CMD;*/DE
	PIP VDDRV.OBJ;*/DE
	PIP VDTBL.OBJ;*/DE
