Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99g-bb - qsrmda.c08
There is 1 other file named qsrmda.c08 in the archive. Click here to see a list.
 INS 3/4	;08C1
	;**;[1153]ADD 3 LINE TO ENTRY POINTS	18-0CT-83/CTK
	TOPS10<					;[1153]MAKE TOPS10 ONLY
		INTERN	D$CCHK			;[1153]CHECK STATUS OF STRUCTURE
	>					;[1153]
 REP 44/18	;08C2
		LOAD	T2,.MRFLG(AP),MR.QUE	;GET OBJECT TYPE
 WIT
		LOAD	T2,.VSRFL(P2),MR.QUE	;[1173] GET OBJECT TYPE
 REP 12/20	;08C3
		SKIPE	G$QUEUE##		;ARE CREATES VALID ???
		JRST	E$OHR##			;NO,,RETURN AN ERROR !!!
 WIT
	;**;[1152]REVAMP CODE AT D$MOUNT:+2L	18-SEP-83/CTK
		$SAVE	<S2>			;[1152]SAVE THIS FOR NOW
		MOVE	S2,G$QUEUE##		;[1152]GET THE ENABLE/DISABLE FLAG
		LOAD	S1,.MMHSZ+.MEHDR(M),AR.TYP ;[1152]AND GET THE ARG TYPE
		CAXN	S1,.MNTTP		;[1152]TAPE?
		 TXNN	S2,E.TAPQ		;[1152]YES..NOW IS IT DISABLED?
		  SKIPA				;[1152]...
		   JRST	E$MTA##			;[1152]YEP..LOOSE BIG
		CAXN	S1,.MNTST		;[1152]NO TO SOMEONE..MAYBE DISK?
		 TXNN	S2,E.DSKQ		;[1152]YEP..DID OPR DISABLE DSK QUEUES?
		  SKIPA				;[1152]...
		   JRST	E$DSK##			;[1152]OH WELL...
		SETZM	S1			;[1152]MAKE SURE THIS IS ZERO
 REP 50/20	;08C4
		STORE	S2,.MRFLG(AP),MR.ACK	;SAVE IT
 WIT
		STORE	S2,.VSRFL(P1),MR.ACK	;[1173] SAVE IT IN VSL
 INS 22/23	;08C5
		SETZM	.MRFLG(AP)		;[1173] START CLEAN
 REP 27/23	;08C6
		LOAD	S2,.MSTYP(M),MS.TYP	;GET THE MESSAGE TYPE
		CAXE	S2,.QIFNC		;IS THIS AN INTERNAL CALL ???
		SETZM	S1			;NO,,CLEAR [SYSTEM]GOPHER BIT
 WIT
	;**;[1170] Delete 3 lines after CMDR.2+12L. 29-Dec-83 /LWS
 INS 48/23	;08C7
		PUSHJ	P,MDR2VS		;[1173] COPY VSL REQUEST DEPENDENT DATA
 INS 51/23	;08C8
		SETOM	.MRFLG(AP)		;[1173] INDICATE MDR ACK DATA COPIED
 INS 31/24	;08C9
		MOVX	S1,MR.ACK		;[1173] HE HAS MOUNTS, HE'LL
		IORM	S1,.MRFLG(AP)		;[1173] NEED 2 ACKS TO GET OUT OF MOUNT
 REP 30/29	;08C10
	;**;[1134]DELETE FIVE LINES AND IDN.1A LABEL AFTER IDEN.1:+27L	7-JUN-83/CTK 
 WIT
	;**;[1134]DELETE FIVE LINES AND IDN.1A LABEL AFTER IDEN.1:+27L	7-JUN-83/CTK
 REP 14/31	;08C11
		DMOVE	P1,S1			;GET THE UCB IN P1, VSL IN P2
 WIT
	;**;[1164] Add some code to check or reinit'ing
		MOVE	T1,.VSFLG(S2)		;[1164] GET VSL FLAGS
		TXNE	T1,VS.INI		;[1164] REINIT'ING?
		$RETF				;[1164] YES,,RETURN
		TXNN	T1,VS.NEW		;[1164] VSL NEED REINIT'ING?
		JRST	REAS.A			;[1164] NO,,TRY REASSIGNMENT
		PUSHJ	P,REINIT		;[1164] YES,,GO SEND REINIT MSG TO PULSAR
		$RETF				;[1164] RETURN

	REAS.A:	DMOVE	P1,S1			;[1164] GET THE UCB IN P1, VSL IN P2
 INS 15/32	;08C12
		MOVE	S1,P2			;[1173] COPY VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
 INS 33/34	;08C13
		MOVE	S1,P2			;[1173] GET VSL ADDRESS
		SETZM	S2			;[1173] USE VSL ACK DATA
 REP 8/39	;08C14
	D$RECO:	PUSHJ	P,.SAVE1		;SAVE P1 FOR A MINUTE
 WIT
	D$RECO:	PUSHJ	P,.SAVE2		;[1204] SAVE P1 & P2  FOR A MINUTE
 REP 15/39	;08C15
		MOVE	S1,S2			;GET THE DEVICE CHECKED AGAINST
 WIT
		SKIPN	P1,.UCBVL(S1)		;[1204] GET VOL BLOCK ADDRES
		JRST	RECO.1			;[1204] NONE THERE
		LOAD	P2,.VLFLG(P1),VL.STA	;[1204] GET THE STATUS
		CAXE	P2,%STADM		;[1204] WAITING TO DISMOUNT?
		JRST	RECO.1			;[1204] NO,,LET PULSAR SNIFF ON IT
		$ACK	(<Structure ^W/.VLNAM(P1)/ is dismounting from ^W/S2/>,,,.MSCOD(M),<$WTFLG(WT.SJI)>) ;[1204]
		$RETT				;[1204] RETURN
	RECO.1:	MOVE	S1,S2			;[1204] GET THE DEVICE CHECKED AGAINST
 INS 15/50	;08C16
		LOAD	S2,.VSFLG(S1),VS.INI	;[1164] GET NEW-VOLUME INITIALIZATION BIT
		JUMPN	S2,MNT.2A		;[1164] IF LIT,,SKIP THIS VSL
 REP 31/59	;08C17
	DISM.1:	$ACK	(Structure ^W/P1/ is not mounted,,,.MSCOD(M),<$WTFLG(WT.SJI)>)
 WIT
	DISM.1:	MOVEI	S1,[ASCIZ |is not mounted|] ;[1204] GET STRING ADDR
		CAXN	S2,%STADM		;[1204] DISMOUNT IN PROGRESS?
		MOVEI	S1,[ASCIZ |- dismount already in progress|] ;[1204] YES
		$ACK	(<Structure ^W/P1/ ^T/(S1)/>,,,.MSCOD(M),<$WTFLG(WT.SJI)>) ;[1204]
 REP 15/63	;08C18
		$ACK	(<Mount request #^D/.VSRID(P1),VS.RID/ cancelled>,<User: [SYSTEM] for ^15/.MRFLG(AP),MR.QUE/ Request #^D/S1/^M^JVolume-set-name: ^T/.VSVSN(P1)/>,,.MSCOD(M))
		MOVE	S1,[POINT 7,G$MSG]	;GET A FRESH BUFFER POINTER
		MOVEM	S1,MDBPTR		;SAVE FOR TEXT OUTPUT ROUTINE
		LOAD	S1,.VSFLG(P1),VS.VSW	;SWITCHING VOLUMES ????
		JUMPN	S1,DELVSW		;YES,,PROCESS DIFFERENTLY !!!
 WIT
		$ACK	(<Mount request #^D/.VSRID(P1),VS.RID/ cancelled>,<User: [SYSTEM] for ^15/.VSRFL(P1),MR.QUE/ Request #^D/S1/^M^JVolume-set-name: ^T/.VSVSN(P1)/>,,.MSCOD(M)) ;[1173]
		MOVE	S1,[POINT 7,G$MSG]	;GET A FRESH BUFFER POINTER
		MOVEM	S1,MDBPTR		;SAVE FOR TEXT OUTPUT ROUTINE
	;**;[1162] Insert 3 lines after DELREQ+11L. 29-Nov-83 /LWS
		MOVE	S1,.VSFLG(P1)		;[1162] GET VSL FLAGS
		TXNE	S1,VS.VSW		;[1162] SWITCHING VOLUMES?
		JRST	DELVSW			;[1162] YES,,PROCESS DIFFERENTLY !!!
 REP 26/63	;08C19
		PUSHJ	P,USRNOT		;TELL THE SAD STORY TO THE USER
		MOVE	S1,P1			;GET THE VSL ADDRESS
 WIT
		MOVE	S1,P1			;[1173] GET VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
		PUSHJ	P,USRNOT		;TELL THE SAD STORY TO THE USER
		MOVE	S1,.VSFLG(P1)		;[1164] GET VSL FLAGS
		TXNN	S1,VS.INI		;[1164] REINIT'ING?
		JRST	DELR.0			;[1164] NO,,CONTINUE
		MOVE	S1,.VSVOL(P1)		;[1164] YES,,GET ADDR OF 1ST VOL BLOCK
		MOVE	TF,S1			;[1164] SAVE VOL BLOCK ADDR
		SKIPN	S1,.VLUCB(S1)		;[1164] GET UCB BLOCK ADDR
		JRST	DELR.0			;[1164] NOT THERE,,OH WELL
		MOVX	S2,UC.INI		;[1164] GET UCB INI STATUS BIT
		ANDCAM	S2,.UCBST(S1)		;[1164] CLEAR THE BIT
		MOVE	S1,TF			;[1164] GET VOL BLOCK ADDR BACK
		PUSHJ	P,VLBREAK		;[1164] GO BREAK VOL/UCB LINK
	DELR.0:	MOVE	S1,P1			;[1164] GET THE VSL ADDRESS
 REP 5/64	;08C20

	DELVSW:	$TEXT	(MDADBP,<Volume switch request ^T/.VSVSN(P1)/ canceled by the operator^A>)
		SKIPE	P4			;NO REASON,,SKIP
		$TEXT	(MDADBP,<^M^JReason:^T/0(P4)/^A>) ;ADD THE REASON
		SETZM	S1			;GET A NULL BYTE 
		IDPB	S1,MDBPTR		;MAKE THE MESSAGE TEXT ASCIZ
		SETOM	ERRACK			;INDICATE THIS IS AN ERROR ACK
		PUSHJ	P,USRNOT		;TELL THE SAD STORY TO THE USER
		MOVE	S1,.VSUCB(P1)		;GET THE UNIT HE CURRENTLY OWNS
		MOVE	S2,.VSFLG(P1)		;GET THE VSL FLAG BITS
		TXZ	S2,VS.VSW		;NO SWITCHING VOLS
		TXO	S2,VS.ABO		;ABORTED BY THE OPERATOR
		MOVEM	S2,.VSFLG(P1)		;SAVE THE NEW STATUS
		MOVX	S2,UC.VSW		;GET UNIT VOL SWITCH STATUS
		ANDCAM	S2,.UCBST(S1)		;CLEAR IT
		MOVX	S2,%VABT		;GET 'CANCELLED' STATUS
		PUSHJ	P,VSREOV		;GET USER OUT OF 'EW'
		LOAD	S1,.VSCVL(P1),VS.OFF	;GET THE OFFSET TO THE CURRENT VOLUME
		ADDI	S1,.VSVOL(P1)		;POINT OT THE VOL BLOCK ADDRESS
		MOVE	S2,0(S1)		;GET THE VOL BLOCK ADDRESS
		SETZM	0(S1)			;ZAP THE VOL BLOCK ADDRESS
		DECR	.VSCVL(P1),VS.CNT	;SUBTRACT 1 FROM VOLUME COUNT
		DECR	.VSCVL(P1),VS.OFF	;POINT TO THE PREVIOUS VOLUME
 WIT
		;S1 = VSL flag bits !!!

	DELVSW:	$SAVE	<T1,T2>			;[1162] SAVE T1 AND T2
		MOVE	T1,S1			;[1162] COPY VSL FLAGS
		TXNN	S1,VS.ALB		;[1162] IS PULSAR THE ONE?
		SKIPA	S2,[[ASCIZ\operator\]]	;[1162] NO,,OPERATOR IS CANCELING
		MOVEI	S2,[ASCIZ\tape labeler\];[1162] YES,,GET CORRECT STRING ADDRESS
		TXZ	S1,VS.VSW!VS.ALB	;[1162] NOT SWITCHING VOLS ANYMORE
		TXO	S1,VS.ABO		;[1162] WE'RE NOW ABORTED
		MOVEM	S1,.VSFLG(P1)		;[1162] UPDATE FLAGS
		$TEXT	(MDADBP,<Volume switch request ^T/.VSVSN(P1)/ canceled by the ^T/(S2)/^A>) ;[1162]
		SKIPE	P4			;NO REASON,,SKIP
		$TEXT	(MDADBP,<^M^JReason:^T/0(P4)/^A>) ;ADD THE REASON
		SETZM	S1			;GET A NULL BYTE
		IDPB	S1,MDBPTR		;MAKE THE MESSAGE TEXT ASCIZ
		SETOM	ERRACK			;INDICATE THIS IS AN ERROR ACK
		MOVE	S1,P1			;[1173] GET VSL ADDRESS
		SETZM	S2			;[1173] USE VSL ACK DATA
		PUSHJ	P,USRNOT		;TELL THE SAD STORY TO THE USER
		MOVE	S1,.VSUCB(P1)		;GET THE UNIT HE CURRENTLY OWNS
		MOVX	S2,UC.VSW		;GET UNIT VOL SWITCH STATUS
		ANDCAM	S2,.UCBST(S1)		;CLEAR IT
		TXNE	T1,VS.ALB		;[1162] ABORTED BY PULSAR?
		JRST	DEL.V1			;[1162] YES,,ALREADY OUT OF 'EW'
		MOVX	S2,%VABT		;GET 'CANCELLED' STATUS
		PUSHJ	P,VSREOV		;GET USER OUT OF 'EW'
	DEL.V1:	LOAD	T1,.VSCVL(P1),VS.OFF	;[1162] GET OFFSET TO VOL HE CAN'T HAVE
		LOAD	T2,.VSCVL(P1),VS.PRE	;[1162] GET OFFSET TO VOL HE'S KEEPING
		STORE	T2,.VSCVL(P1),VS.OFF	;[1162] SET CURRENT OFFSET TO PREVIOUS ONE

	; Put things back together for tape user is stuck with because of
	; volume switch abort.

		MOVE	S1,P1			;[1162] GET VSL ADDRESS
		PUSHJ	P,CHKOWN		;[1162] GET VOL BLOCK POINTER TO VSL ADDR
		MOVX	S2,VL.ASN		;[1162] GET ASSIGNED BIT
		IORM	S2,0(S1)		;[1162] INDICATE THE OLD VOL STILL ASSIGNED
		PUSHJ	P,D$CMTX		;[1162] LOCATE THE GUY'S 'C' MATRIX ENTRY
		ADDI	T2,.VSVOL(P1)		;[1162] GET ITS VOL BLOCK POINTER ADDR
		MOVE	S1,(T2)			;[1162] PUT ADDR INTO S1 FOR D$TVSR
		PUSHJ	P,D$TVRS		;[1162] CONVERT TO RESOURCE NUMBER
		MOVE	S2,P1			;[1162] GET VSL ADDRESS
		PUSHJ	P,ADDAMA		;[1162] PUT VOLUME BACK IN 'A' MATRIX
		PUSHJ	P,ADDCMA		;[1162] PUT VOLUME BACK IN 'C' MATRIX

	; If user was trying to extend volume set make sure "scratch" vol
	; block is deleted.

		ADDI	T1,.VSVOL(P1)		;[1162] POINT AT THE VOL BLOCK ADDR OF TAPE HE CAN'T HAVE
		MOVE	S2,0(T1)		;[1162] GET THE VOL BLOCK ADDRESS
		LOAD	S1,.VLFLG(S2),VL.SCR	;[1162] GET SCRATCH BIT
		JUMPE	S1,.RETT		;[1162] SCRATCH??? NO, RETURN
		SETZM	0(T1)			;[1162] YES, ZAP THE VOL BLOCK ADDRESS
		DECR	.VSCVL(P1),VS.CNT	;SUBTRACT 1 FROM VOLUME COUNT
 INS 16/66	;08C21
	;**;[1211]ADD 2 LINES AT STAP:+13L	16-MAY-84/CTK
		MOVX	S2,UC.AVR		;[1211]GET THE AVR BIT
		TDNE	S2,.UCBST(P2)		;[1211]NEED TO KICK PULSAR FOR AVR ???
 REP 36/67	;08C22
		LOAD	T1,.VSCVL(P2),VS.OFF	;GET THE OFFSET TO THE CURRENT VOLUME
 WIT
	;**;[1162] Redo code after D$VSR+18L (approx). 29-Nov-83 /LWS
		CAXE	S2,%RLABO		;[1162] SHOULD WE ABORT THE SWITCH?
		JRST	VSR.T2			;[1162] NO...
		MOVX	S1,VS.ALB		;[1162] YES,,GET ABORTED BY TAPE LBLR BIT
		IORM	S1,.VSFLG(P2)		;[1162] LITE IT IN VSL FLAG WORD
		SETZM	P4			;[1162] NO REASON
		MOVE	S1,P2			;[1162] GET VSL ADDRESS
		PJRST	DELREQ			;[1162] GO DELETE VOLUME SWITCH

	VSR.T2:	LOAD	T1,.VSCVL(P2),VS.OFF	;[1162] GET THE OFFSET TO THE CURRENT VOLUME
		MOVE	P3,T1			;[1162] WILL BE USED AS PREVIOUS LATER
 INS 33/68	;08C23
	;**;[1162] Insert 1 line at VSR.1+7L . 18-Oct-83 /LWS
		STORE	P3,.VSCVL(P2),VS.PRE	;[1162]SAVE OFFSET OF PREVIOUS VOL, TOO
 INS 20/71	;08C24
	;**;[1170] Insert 1 line after D$DVS+11L. 29-Dec-83 /LWS
		STORE	S1,.MRFLG(AP),MR.GFR	;[1170] CLEAR [SYSTEM]GOPHER BIT (CLEAN UP)
 INS 10/72	;08C25
		PUSHJ	P,MDR2VS		;[1173] COPY VSL REQUEST DEPENDENT DATA
 INS 28/72	;08C26
		MOVE	S1,P1			;[1173] GET VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
 INS 44/72	;08C27
		MOVE	S1,P1			;[1173] GET VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
 INS 52/72	;08C28
		MOVE	S1,P1			;[1173] GET VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
 INS 49/74	;08C29
		MOVE	S1,P4			;[1173] GET VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
 INS 38/79	;08C30
		MOVE	S1,P3			;[1173] GET VSL ADDRESS
		SETZM	S2			;[1173] USE VSL ACK DATA
 INS 20/83	;08C31
		MOVE	S1,P1			;[1173] GET VSL ADDRESS
		SETZM	S2			;[1173] USE VSL ACK DATA
 INS 46/84	;08C32
		MOVE	S1,P1			;[1173] GET VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
 REP 24/85	;08C33
		MOVE	S1,.MRFLG(AP)		;GET WAIT/NOTIFY/ACK FLAGS ETC.
		TXNE	S1,MR.WAT		;WAITING?
		TXO	S1,MR.ACK		;THEN WE WANT TO ACK VIA IPCF
		MOVEM	S1,.MRFLG(AP)		;RESTORE FLAG WORD
		MOVX	S1,MR.DMO		;GET DISMOUNT BIT
		IORM	S1,.MRFLG(AP)		;LITE IT SO USRNOT DOES PRETTY THINGS
 WIT
		MOVE	S2,(P)			;[1173] GET VSL ADDRESS AGAIN
		MOVE	S1,.VSRFL(S2)		;[1173] GET WAIT/NOTIFY/ACK FLAGS ETC.
		TXNE	S1,MR.WAT		;WAITING?
		TXO	S1,MR.ACK		;THEN WE WANT TO ACK VIA IPCF
		MOVEM	S1,.VSRFL(S2)		;[1173] RESTORE FLAG WORD
		MOVX	S1,MR.DMO		;GET DISMOUNT BIT
		IORM	S1,.VSRFL(S2)		;[1173] LITE IT SO USRNOT DOES PRETTY THINGS
		MOVE	S1,S2			;[1173] GET VSL ADDRESS
		SETZM	S2			;[1173] USE VSL ACK DATA!
 REP 45/85	;08C34
	RMSA.2:	POP	P,S1			;RESTORE THE VSL ADDRESS
		$TEXT	(<-1,,G$MSG>,<Can't dismount structure ^T/.VSVSN(S1)/^M^J^T/(P2)/^0>)
		SETOM	ERRACK			;IS THIS AN ERROR
 WIT
	RMSA.2:	MOVE	S1,(P)			;[1173] GET VSL ADDRESS
		$TEXT	(<-1,,G$MSG>,<Can't dismount structure ^T/.VSVSN(S1)/^M^J^T/(P2)/^0>)
		SETOM	ERRACK			;IS THIS AN ERROR
		POP	P,S1			;[1173] RESTORE VSL ADDRESS
		SETZM	S2			;[1173] USE VSL ACK DATA
 REP 30/86	;08C35
		CAXE	S1,%STAWT		;IS IT WAITING ???
		JRST	ALIA.1			;NO,,TRY NEXT VOLUME
 WIT
	;**;[1204] Change code at ALIA.2+7L. /LWS
		CAXN	S1,%STAWT		;[1204] IS IT WAITING ???
		JRST	ALIA2A			;[1204] YES,,GO PROCESS
		CAXE	S1,%STADM		;[1204] NO,,DISMOUNTING???
		JRST	ALIA.1			;NO,,TRY NEXT VOLUME
		MOVEI	S1,[ITEXT(<Structure ^W/P1/ is dismounting>)] ;[1204]
		JRST	ALIA.E			;[1204] GO ACK
 REP 35/86	;08C36
		MOVE	P1,S2			;SAVE THE PRIMARY VOL BLOCK ADDRESS
 WIT
	ALIA2A:	MOVE	P1,S2			;[1204] SAVE THE PRIMARY VOL BLOCK ADDRESS
 INS 8/88	;08C37
	;**;[1153]ADD 1 LINE AT CHKSTR:-1L	18-OCT-83/CTK
	D$CCHK:					;[1153]EXTERNAL ENTRY POINT
 INS 1/99	;08C38
		SUBTTL	REIMSG - ROUTINE TO SEND REINITIALIZATION MESSAGE TO PULSAR

	;[1164] The REINIT message is really an device INITIALIZATION message
	;[1164] with a couple extra arg blocks. The message is sent to PULSAR
	;[1164] when the user specifies /NEW-VOLUME in his/her mount command.
	;[1164] The allows to user to reinitalize the tapes before useing them.

	;[1164] Offsets for prototype reinit message

		.TAPOF==.OHDRS				;[1164] DEVICE BLOCK OFFSET
		.RIDOF==.TAPOF+ARG.SZ+1			;[1164] REQUEST ID BLOCK OFFSET
		.DVIOF==.RIDOF+ARG.SZ			;[1164] DEVICE INI BLOCK OFFSET
		.LBTOF==.DVIOF+1			;[1164] LABEL TYPE BLOCK OFFSET
		.DENOF==.LBTOF+ARG.SZ			;[1164] DENSITY BLOCK OFFSET
		.PROOF==.DENOF+ARG.SZ			;[1164] PROTECTION BLOCK OFFSET
		.OWNOF==.PROOF+ARG.SZ			;[1164] OWNER PPN
		.HLDOF==.OWNOF+ARG.SZ			;[1164] HOLD TAPE BLOCK OFFSET
		.OVROF==.HLDOF+1			;[1164] OVERRIDE EXP DATE OFFSET
		.CTROF==.OVROF+1			;[1164] COUNT BLOCK OFFSET
		.NEWOF==.CTROF+ARG.SZ			;[1164] NEW-VOLUME BLOCK OFFSET
		.LISOF==.NEWOF+1			;[1164] VOL LIST BLOCK OFFSET
		REIMSZ==.LISOF+ARG.SZ			;[1164] MINIMUM REINIT MSG SIZE

	;[1164] Prototype tape reinitialization mesage sent to PULSAR

	REIMSG:	$BUILD(REIMSZ)
		  $SET(.MSTYP,MS.TYP,.ODSTP)		;[1164] SET TAPE FUNCTION
		  $SET(.OARGC,,^D12)			;[1164] NUMBER OF ARG BLOCKS
		  $SET(.TAPOF+ARG.HD,,<ARG.SZ+1,,.TAPDV>);[1164] DEVICE BLOCK HEADER
		  $SET(.RIDOF+ARG.HD,,<ARG.SZ,,.ORREQ>)	;[1164] REQUEST ID BLOCK
		  $SET(.DVIOF+ARG.HD,,<1,,.DVINI>)	;[1164] DEVICE INI FUNCTION
		  $SET(.LBTOF+ARG.HD,,<ARG.SZ,,.SILBT>)	;[1164] LABEL TYPE BLOCK HEADER
		  $SET(.DENOF+ARG.HD,,<ARG.SZ,,.SIDEN>)	;[1164] DENSITY BLOCK HEADER
		  $SET(.PROOF+ARG.HD,,<ARG.SZ,,.SIPRO>)	;[1164] PROTECTION BLOCK HEADER
		  $SET(.OWNOF+ARG.HD,,<ARG.SZ,,.SIOWN>)	;[1164] OWNER PPN
		  $SET(.HLDOF+ARG.HD,,<1,,.SIHLD>)	;[1164] HOLD TAPE BLOCK
		  $SET(.OVROF+ARG.HD,,<1,,.SIOVR>)	;[1164] OVERRIDE EXP DATE BLOCK
		  $SET(.CTROF+ARG.HD,,<ARG.SZ,,.SICTR>)	;[1164] COUNT BLOCK HEADER
		  $SET(.NEWOF+ARG.HD,,<1,,.SINEW>)	;[1164] NEW-VOLUME BLOCK
		  $SET(.LISOF+ARG.HD,,<ARG.SZ,,.SILST>)	;[1164] VOL LIST BLOCK
		$EOB

	;Build reinit message in prototype and then copy to G$MSG.

	REINIT:	PUSHJ	P,.SAVE4		;[1164] SAVE P1-P4
		DMOVE	P1,S1			;[1164] GET P1 = UCB, P2 = VSL
		SETZM	REIMSG+.TAPOF+ARG.DA+1	;[1164] ZERO THIS WORD
		MOVE	S1,[POINT 6,.UCBNM(P1)]	;[1164] MAKE SOURCE BYTE POINTER
		MOVE	S2,[POINT 7,<REIMSG+.TAPOF+ARG.DA>] ;[1164] GET DEST BP
		PUSHJ	P,SX2ASC		;[1164] CONVERT SIXBIT TO ASCII (SIGH)
		LOAD	S1,.VSRID(P2),VS.RID	;[1164] GET REQUEST ID
		MOVEM	S1,REIMSG+.RIDOF+ARG.DA	;[1164] STORE IN MSG
		LOAD	S1,.VSFLG(P2),VS.LBT	;[1164] GET LABEL TYPE
		MOVEM	S1,REIMSG+.LBTOF+ARG.DA	;[1164] STORE IN MSG
		MOVX	S2,.TFD00		;[1164] ASSUME DENSITY DEFAULTED
		MOVX	S1,VS.DDN		;[1164] GET DEFAULTED DENSITY BIT
		TDNN	S1,.VSATR(P2)		;[1164] DID WE DEFAULT THE DENSITY?
		LOAD	S2,.VSATR(P2),VS.DEN	;[1164] NO,,GET DENSITY USER WANTS
		MOVEM	S2,REIMSG+.DENOF+ARG.DA	;[1164] STORE IN MSG
		SETOM	S2			;[1164] ASSUME PROTECTION NOT SPECIFIED
		MOVX	S1,VS.DPR		;[1164] GET DEFAULT PROTECTION BIT
		TDNN	S1,.VSATR(P2)		;[1164] DID USER SPECIFY /PROT:?
		LOAD	S2,.VSATR(P2),VS.PRT	;[1164] YES,,GET PROTECTION HE WANTS
		MOVEM	S2,REIMSG+.PROOF+ARG.DA	;[1164] STORE IN MSG
		MOVE	S1,.MRUSR(AP)		;[1164] GET REQUESTOR'S PPN
		MOVEM	S1,REIMSG+.OWNOF+ARG.DA	;[1164] STORE IN MSG
		LOAD	S1,.VSCVL(P2),VS.CNT	;[1164] GET VOL COUNT
		MOVEM	S1,REIMSG+.CTROF+ARG.DA	;[1164] STORE IN MSG
		MOVN	P3,S1			;[1164] SAVE NEGATIVE VOL COUNT
		ADDI	S1,1			;[1164] GET CORRECT LENGTH FOR .SILST BLK
		STORE	S1,REIMSG+.LISOF+ARG.HD,AR.LEN ;[1164] SET CORRECT LENGTH
		ADDI	S1,REIMSZ-2		;[1164] COMPUTE MSG SIZE
		STORE	S1,REIMSG+.MSTYP,MS.CNT	;[1164] STORE IN MSG
		MOVE	S2,[REIMSG,,G$MSG]	;[1164] COPY OUR MSG TO G$MSG BUFFER
		BLT	S2,G$MSG-1(S1)		;[1164] ..
		HRLZS	P3			;[1164] MAKE AOBJN PTR FOR VOLS
		HRRI	P3,G$MSG+.LISOF+ARG.DA	;[1164] ..

	;[1164] Copy VOLIDs to reinit message.

		MOVEI	P4,.VSVOL(P2)		;[1164] GET ADDR TO 1ST VOL BLOCK PTR
	REIN.1:	SKIPN	S1,(P4)			;[1164] GET VOL BLOCK ADDR
		  $STOP	(MVP,<Missing VOL block pointer>) ;[1164] OOPS!!!
		MOVE	S2,.VLNAM(S1)		;[1164] GET VOLID
		MOVEM	S2,(P3)			;[1164] STORE IN MESSAGE
		MOVEI	S2,%STAIN		;[1164] STATUS CODE FOR 'INITIALIZING'
		STORE	S2,.VLFLG(S1),VL.STA	;[1164] SET FOR ACCURATE QUEUE LISTINGS
		ADDI	P4,1			;[1164] BUMP VOL BLOCK ADDR PTR
		AOBJN	P3,REIN.1		;[1164] LOOP FOR ALL VOLS

	;[1164] Send message to PULSAR and finish up.

		MOVE	S1,.VSFLG(P2)		;[1164] GET VSL FLAGS
		TXZ	S1,VS.NEW		;[1164] TURN OFF NEW-VOLUME BIT
		TXO	S1,VS.INI		;[1164] TURN ON REINIT-PROGRESS BIT
		MOVEM	S1,.VSFLG(P2)		;[1164] PUT FLAGS BACK
		MOVX	S1,UC.INI		;[1164] GET INI BIT FOR UCB
		IORM	S1,.UCBST(P1)		;[1164] LITE IT IN UCB STATUS WORD
		MOVEI	M,G$MSG			;[1164] GET MSG ADDR IN M
		PJRST	I$FPLR##		;[1164] SEND MESSAGE TO PULSAR

	;[1164] ;Convert SIXBIT to ASCII
	;[1164]
	;[1164] 	S1 = Source BP
	;[1164] 	S2 = Destination BP
	;[1164] 	Only 6 chars are converted and S1, S2 are returned updated

	SX2ASC:	$SAVE	<T1,T2>			;[1164] SAVE T1, T2
		MOVEI	T2,6			;[1164] ONLY 6 CHARS CONVERTED
	SX2A.1:	ILDB	T1,S1			;[1164] GET A BYTE
		ADDI	T1,40			;[1164] ASCIIZE
		IDPB	T1,S2			;[1164] STORE IN DESTINATION
		SOJG	T2,SX2A.1		;[1164] LOOP FOR 6 CHARS
		POPJ	P,			;[1164] RETURN
 REP 7/110	;08C39
	USRACK:	PUSHJ	P,.SAVE3		;SAVE P1 - P3
		MOVE	S1,[POINT 7,G$MSG]	;GET OUTPUT BYTE POINTER
		MOVEM	S1,MDBPTR		;SAVE IT FOR LATER
		SETZM	G$MSG##			;CLEAR THE FIRST WORD...
 WIT
	USRACK:	PUSHJ	P,.SAVE4		;[1173] SAVE P1 - P4
		MOVE	S1,[POINT 7,G$MSG]	;GET OUTPUT BYTE POINTER
		MOVEM	S1,MDBPTR		;SAVE IT FOR LATER
		SETZB	P4,G$MSG##		;[1173] CLEAR P4 AND FIRST WORD OF MSG
 REP 25/110	;08C40

	USRA.2:	AOBJN	P1,USRA.1		;LOOP THROUGH ALL VSL'S
		SETZM	S1			;GET A NULL BYTE
		PUSHJ	P,MDADBP		;MAKE IT ASCIZ
 WIT
		MOVE	P4,P2			;[1173] SAVE VSL ADDRESS

	USRA.2:	AOBJN	P1,USRA.1		;LOOP THROUGH ALL VSL'S
		JUMPE	P4,.RETT		;[1173] SHOULDN'T HAPPEN, BUT.....
		SETZM	S1			;GET A NULL BYTE
		PUSHJ	P,MDADBP		;MAKE IT ASCIZ
	;**;[1170] Insert 3 lines after USRA.2+2L. 29-Dec-83 /LWS
		MOVE	S1,.VSRFL(P4)		;[1173] [1170] GET VSL ACK DATA FLAGS
		TXZE	S1,MR.GFR		;[1173] CLEAR GOPHER BIT
		EXCH	S1,.VSRFL(P4)		;[1173] GET ORIGINAL BITS AND UPDATE TOO
		JUMPN	P3,USRA.3		;[1173] [1170] ALWAYS TRY TO GIVE ALLOC ACK
		TXNE	S1,MR.GFR		;[1173] [1170] GOPHER ONLY WANTS ACK WHEN MOUNTED
		$RETT				;[1173] RETURN
	USRA.3:	MOVE	S1,P4			;[1173] GET VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
 INS 8/111	;08C41
		$SAVE	<T3>			;[1173] SAVE T3, TOO
 INS 42/111	;08C42
		MOVE	T3,P4			;[1173] SAVE VSL ADDR FOR ACKING
 REP 30/113	;08C43
		PUSHJ	P,USRNOT		;SEND THE MESSAGE OFF
		ZERO	.MRFLG(AP),MR.WAT	;CLEAR THE WAITING FOR ACK BIT
 WIT
		MOVE	S1,T3			;[1173] GET VSL ADDRESS
		SETOM	S2			;[1173] USE MDR ACK DATA IF VALID
		PUSHJ	P,USRNOT		;SEND THE MESSAGE OFF
		ZERO	.VSRFL(P4),MR.WAT	;[1173] CLEAR THE WAITING FOR ACK BIT
 INS 25/114	;08C44
		TXNN	S2,VS.INI		;[1164] CHECK FOR /NEW-VOLUME INITIALIZATION
 REP 9/115	;08C45
		  JRST	TMTA.1			;NOT SPECIFIED, EVERYTHING OK
		$TEXT	(<-1,,VOLID>,<^W/.VLNAM(P3)/^0>) ;NO,,GEN ASCIZ VOLID
		MOVEI	S2,NONEWT		;GET THE TEXT TO LABEL THE TAPES

 WIT
		  JRST	TMTA.1			;[1164] IT'S SCRATCH
		$TEXT	(<-1,,VOLID>,<^W/.VLNAM(P3)/^0>) ;NO,,GEN ASCIZ VOLID
	;**;[1164] Redo code for /NEW-VOLUME
		MOVEI	S2,NONEWT		;[1164] ASSUME NOT NEW
		MOVX	T3,VS.NEW		;[1164] GET /NEW-VOLUME BIT
		TDNN	T3,.VSFLG(T1)		;[1164] IS IT LIT?
		  JRST	TMTA.1			;[1164] NO,,CONTINUE
		LOAD	S2,.VSCVL(T1),VS.CNT	;[1164] GET COUNT OF VOLS IN VSN
		CAIN	S2,1			;[1164] ONE VOLUME?
		SKIPA	S2,[REITX1]		;[1164] YES
		MOVEI	S2,REITX2		;[1164] ELSE USE MULTI-VOL TEXT
		JRST	TMTA.2			;[1164] SKIP LABEL TYPE CHECK
 REP 18/115	;08C46
		LOAD	P4,.VSFLG(T1),VS.WLK	;GET THE WRITE-LOCKED CODE
 WIT
	TMTA.2:	LOAD	P4,.VSFLG(T1),VS.WLK	;[1164] GET THE WRITE-LOCKED CODE
 REP 28/115	;08C47
		$WTO	(<Magtape mount request #^D/.VSRID(T1),VS.RID/>,<User: [SYSTEM] for ^15/.MRFLG(AP),MR.QUE/ Request #^D/S1/^T/RMK/^M^JVolume-set-name: ^T/.VSVSN(T1)/^T/MTAHDR/^T11/VOLID/^T9/@WRTENA(P4)/^T9/@LABELS(T2)/^W6/TRK(T3)/^T/@DENSTY(T4)/^I/(S2)/>,,<$WTFLG(WT.SJI)>)
		$RETT				;RETURN

	NEWTXT:	ITEXT	(<^M^JInitialize new tape with volume-id: ^W/.VLNAM(P3)/ protection: ^O3/.VSATR(T1),VS.PRT/^T/BELLS/>)
 WIT
		$WTO	(<Magtape mount request #^D/.VSRID(T1),VS.RID/>,<User: [SYSTEM] for ^15/.VSRFL(T1),MR.QUE/ Request #^D/S1/^T/RMK/^M^JVolume-set-name: ^T/.VSVSN(T1)/^T/MTAHDR/^T11/VOLID/^T9/@WRTENA(P4)/^T9/@LABELS(T2)/^W6/TRK(T3)/^T/@DENSTY(T4)/^I/(S2)/>,,<$WTFLG(WT.SJI)>) ;[1173]
		$RETT				;RETURN

	NEWTXT:	ITEXT	(<^M^JInitialize new/scratch tape: - Volume-id: ^W/.VLNAM(P3)/ - Protection: ^O3/.VSATR(T1),VS.PRT/^T/BELLS/>) ;[1164]
 INS 38/115	;08C48

	REITX1:	ITEXT	(<^M^JUser requesting reinitialization of 1 volume^T/BELLS/>) ;[1164]
	REITX2:	ITEXT	(<^M^JUser requesting reinitialization of ^D/.VSCVL(T1),VS.CNT/ volumes^T/BELLS/>) ;[1164]
 REP 49/116	;08C49
		$WTO	(<Structure mount request #^D/.VSRID(T1),VS.RID/^T/BELLS/>,<User: [SYSTEM] for ^15/.MRFLG(AP),MR.QUE/ Request #^D/S1/^T/RMK/^T/DSKHDR/^T/G$MSG/>,MDAOBJ)
 WIT
		$WTO	(<Structure mount request #^D/.VSRID(T1),VS.RID/^T/BELLS/>,<User: [SYSTEM] for ^15/.VSRFL(T1),MR.QUE/ Request #^D/S1/^T/RMK/^T/DSKHDR/^T/G$MSG/>,MDAOBJ) ;[1173]
 REP 15/117	;08C50
		$WTO	(<DECtape mount request #^D/.VSRID(T1),VS.RID/>,<User: [SYSTEM] for ^15/.MRFLG(AP),MR.QUE/ Request #^D/S1/^T/RMK/^M^JVolume-set-name: ^T/.VSVSN(T1)/^T/DTAHDR/^T11/VOLID/^T9/@WRTENA(P4)/^T/BELLS/>,,<$WTFLG(WT.SJI)>)
 WIT
		$WTO	(<DECtape mount request #^D/.VSRID(T1),VS.RID/>,<User: [SYSTEM] for ^15/.VSRFL(T1),MR.QUE/ Request #^D/S1/^T/RMK/^M^JVolume-set-name: ^T/.VSVSN(T1)/^T/DTAHDR/^T11/VOLID/^T9/@WRTENA(P4)/^T/BELLS/>,,<$WTFLG(WT.SJI)>) 
 REP 13/118	;08C51
		$WTO	(<Device mount request #^D/.VSRID(T1),VS.RID/^T/BELLS/>,<User: [SYSTEM] for ^15/.MRFLG(AP),MR.QUE/ Request #^D/S1/^T/RMK/^M^JDevice: ^T/@DEVNTB(P4)/>,MDAOBJ)
 WIT
		$WTO	(<Device mount request #^D/.VSRID(T1),VS.RID/^T/BELLS/>,<User: [SYSTEM] for ^15/.VSRFL(T1),MR.QUE/ Request #^D/S1/^T/RMK/^M^JDevice: ^T/@DEVNTB(P4)/>,MDAOBJ) ;[1173]
 INS 4/122	;08C52
		;	S1/ VSL address (for ACK data)
		;	S2/ nonzero - Use MDR ACK data if valid
		;	    zero - Use VSL ACK data
 REP 9/122	;08C53
	USRNOT:	MOVE	S1,.MRFLG(AP)		;GET MDR FLAGS
		TXNE	S1,MR.GFR		;IS THIS FROM [SYSTEM]GOPHER ???
		JRST	[ZERO .MRFLG(AP),MR.GFR	;YES,,CLEAR IT AND
			 $RETT  ]		;RETURN (GOPHER DOESN'T WANT THIS ACK)
		LOAD	S2,.MRJOB(AP),MD.PJB	;GET THE USERS JOB NUMBER
 WIT
	USRNOT:	PUSHJ	P,.SAVE4		;[1173] SAVE P1-P4
		TRVAR	<PID,ACKCOD,FLAGS>	;[1173] DEFINE SOME LOCAL STORAGE
		DMOVE	P2,S1			;[1173] ASSUME WE'LL USE VSL ACK DATA
						;[1173] SAVE S2 TOO
		MOVE	S1,.VSPID(P2)		;[1173] GET PID FROM VSL
		MOVEM	S1,PID			;[1173] STORE IT
		MOVE	S1,.VSACK(P2)		;[1173] GET ACK CODE FROM VSL
		MOVEM	S1,ACKCOD		;[1173] STASH IT
		MOVE	S1,.VSRFL(P2)		;[1173] GET ACKING FLAGS
		MOVEM	S1,FLAGS		;[1173] SAVE THEM
		MOVEI	P4,RSTVSL		;[1173] GET ROUTINE ADDRESS FOR EXIT
		JUMPE	P3,USRN.1		;[1173] JUMP IF ASSUMPTION CORRECT
		MOVE	P1,.MRFLG(AP)		;[1173] GET MDR FLAGS
		CAMN	P1,[-1]			;[1173] MDR ACK DATA VALID?
		JRST	[SETZM P3		;[1173] NO,,REMEMBER FOR LATER
			 JRST USRN.1]		;[1173] WE'RE ALREADY SETUP
		MOVE	S1,.MRPID(AP)		;[1173] GET PID FROM MDR
		MOVEM	S1,PID			;[1173] STORE IT LOCALLY
		MOVE	S1,.MRACK(AP)		;[1173] GET ACK CODE FROM MDR
		MOVEM	S1,ACKCOD		;[1173] STORE IT
		MOVE	S1,.MRFLG(AP)		;[1173] GET FLAGS
		MOVEM	S1,FLAGS		;[1173] STORE THEM
		MOVEI	P4,RSTMDR		;[1173] GET EXIT ROUTINE ADDRESS
	;**;[1170] Delete 3 lines at USRNOT+1L. 29-Dec-83 /LWS
	USRN.1:	LOAD	S2,.MRJOB(AP),MD.PJB	;[1173] GET THE USERS JOB NUMBER
 DEL 19/122	;08C54
	USRN.0:	PUSHJ	P,.SAVE1		;SAVE P1 FOR A SECOND
 REP 24/122	;08C55
		MOVEM	S1,.MRFLG(AP)		;SAVE THE NEW STATUS
 WIT
		MOVEM	S1,FLAGS		;[1173] SAVE THE NEW STATUS
 REP 28/122	;08C56
		MOVE	S1,.MRPID(AP)		;GET USER'S PID
 WIT
		MOVE	S1,PID			;[1173] GET USER'S PID
 REP 40/122	;08C57
		MOVE	S1,.MRACK(AP)		;GET THE MESSAGE ACK CODE
 WIT
		MOVE	S1,ACKCOD		;[1173] GET THE MESSAGE ACK CODE
 REP 52/122	;08C58
		JUMPT	[SETZM ERRACK		;CLEAR THE ERROR FLAG
			 $RETT ]		;AND RETURN
 WIT
		MOVE	S1,P2			;[1173] GET VSL ADDRESS
		PUSHJ	P,(P4)			;[1173] RESTORE ACK DATA
		JUMPF	USRN.N			;[1173] TRY TERMINAL IF FAILURE
		SETZM	ERRACK			;[1173] CLEAR ERROR FLAG
		$RETT				;[1173] RETURN
 REP 4/123	;08C59
	USRN.N:	LOAD	S1,.MRFLG(AP),MR.NOT	;WANT TO BE NOTIFIED?
		JUMPE	S1,[SETZM ERRACK	;NO,,CLEAR THE ERROR FLAG
			    $RETT ]		;AND RETURN
		SKIPA				;ENTER THE COMMON STUFF

	USRN.W:	$SAVE	<P1>			;SAVE A REG
 WIT
	USRN.N:	MOVE	P1,FLAGS		;[1173] GET ACK DATA FLAGS
		TXNE	P1,MR.NOT		;[1173] WANT TO BE NOTIFIED
		JRST	USRN.X			;[1173] YES,,GO TRY IT
		SETZM ERRACK			;[1173] NO,,CLEAR THE ERROR FLAG
		$RETT				;[1173] RETURN

	;[1173] USRN.W will always use VSL ack data when called directly.
	;[1173] S1/ VSL address

	USRN.W:	PUSHJ	P,.SAVE2		;[1173] SAVE P1,P2
		MOVE	P2,S1			;[1173] SAVE VSL ADDRESS
		MOVE	P1,.VSRFL(P2)		;[1173] GET ACK DATA FLAGS FROM VSL
	USRN.X:	STKVAR	<FLAGSX>		;[1173] LOCAL STORAGE
		MOVEM	P1,FLAGSX		;[1173] SAVE FLAGS
 REP 42/123	;08C60
		TDNE	S2,.MRFLG(AP)		;IS THAT WHAT WE'RE DOING?
 WIT
		TDNE	S2,FLAGSX		;[1173] IS THAT WHAT WE'RE DOING?
 INS 52/123	;08C61

	;[1173] Routines to restore ACK data flag word in MDR and VSL.
	;[1173] USRNOT may modify some of the bits.
	;[1173] ** Can only be called from USRNOT **

	;[1173] Call:	AP/ MDR address

	RSTMDR:	MOVE	S1,FLAGS		;[1173] GET FLAGS
		MOVEM	S1,.MRFLG(AP)		;[1173] RESTORE THEM IN MDR
		$RET				;[1173] RETURN TF INTACT

	;[1173] Call:	S1/ VSL address

	RSTVSL:	
		MOVE	S2,FLAGS		;[1173] GET FLAGS
		MOVEM	S2,.VSRFL(S1)		;[1173] RESTORE IN VSL
		$RET				;[1173] RETURN TF INTACT

 REP 18/128	;08C62

	D$SREC::				;MAKE IT GLOBAL
	SNDREC:	SKIPN	S1			;*** MUST BE NON-ZERO ***
		$STOP	(QBI,<QUASAR blew it>)	;++ WE'RE IN TROUBLE NOW
		MOVEM	S1,RECMSG+.OHDRS+ARG.DA	;SAVE THE DEVICE NAME IN THE MESSAGE
 WIT
	;**;[1175] Change some code at D$SREC. /LWS
	D$SREC::				;MAKE IT GLOBAL
	SNDREC:	JUMPN	S1,SNDR.0		;[1175] *** MUST BE NON-ZERO ***
		$WTO	(<Null device name detected>,<Recognize message not sent>,MDAOBJ) ;[1175]
		$RETT				;[1175] RETURN
	SNDR.0:	MOVEM	S1,RECMSG+.OHDRS+ARG.DA	;[1175] SAVE THE DEVICE NAME IN THE MESSAGE
 REP 19/136	;08C63
	D$CCAT::$SAVE	<P1,P2,P3,P4>		;SAVE SOME ACS
		DMOVE	P1,S1			;COPY ARGUMENTS
		DMOVE	P3,P1			;THIS WAY WE'LL NEVER FORGET!
		MOVE	S1,.CTVSN(P1)		;GET OLD VSN
		MOVE	S2,.CTOID(P1)		;GET OLD OWNER
		CAMN	S1,.CTVSN(P2)		;SAME AS NEW VSN?
		CAME	S2,.CTOID(P2)		;SAVE AS NEW OWNER?
		JRST	CCAT.2			;NO
		MOVE	TF,.CTCNT(P1)		;GET OLD VOLUME COUNT
		CAME	TF,.CTCNT(P2)		;SAVE AS NEW VOLUME COUNT?
 WIT
	;**;[1174] Change code in D$CCAT. /LWS
	D$CCAT::$SAVE	<P1,P2,P3,P4>		;SAVE SOME ACS
		$SAVE	<T1>			;[1174] SAVE T1, TOO
		DMOVE	P1,S1			;COPY ARGUMENTS
		DMOVE	P3,P1			;THIS WAY WE'LL NEVER FORGET!
		SETZM	T1			;[1174] CLEAR T1 (USE AS OID DIF FLAG)
		MOVE	S1,.CTOID(P1)		;[1174] GET OLD OWNER
		CAME	S1,.CTOID(P2)		;[1174] SAME AS NEW?
		SETOM	T1			;[1174] NO,,FLAG IT
		MOVE	S1,.CTVSN(P1)		;GET OLD VSN
		MOVE	TF,.CTCNT(P1)		;[1174] GET OLD VOLUME COUNT
		CAMN	S1,.CTVSN(P2)		;[1174] OLD AND NEW VSN THE SAME?
		CAME	TF,.CTCNT(P2)		;[1174] OLD AND NEW VOL COUNT SAME?
 INS 41/136	;08C64
		JUMPL	T1,CCAT2A		;[1174] IF OWNER DIFFERENT INFORM OPR
 REP 1/137	;08C65
	CCAT.2:	PUSHJ	P,CCAT.T		;SET UP TEXT AND WTO STUFF
 WIT
	CCAT.2:	SETZM	T1			;[1174] SOMETHING BESIDES OWNER DIFFERS
	CCAT2A:	PUSHJ	P,CCAT.T		;[1174] SET UP TEXT AND WTO STUFF
 REP 8/137	;08C66
		MOVE	S1,.CTVSN(P4)		;GET NEW VSN
		PUSHJ	P,D$UCAT		;FIND ALL USERS OF THIS ENTRY
		SKIPE	P1,S1			;GET # ALLOCATED
		JRST	CCAT.3			;THERE AREN'T ANY
		JUMPE	P1,CCAT.3		;ARE THERE ANY?
 WIT
		JUMPL	T1,CCAT.3		;[1174] DON'T BOTHER CHECKING ALLOCATION
						;[1174] IF ONLY DIFFERENCE IS OWNER
		MOVE	S1,.CTVSN(P4)		;GET NEW VSN
		PUSHJ	P,D$UCAT		;FIND ALL USERS OF THIS ENTRY
		SKIPN	P1,S1			;[1174] GET # ALLOCATED
		JRST	CCAT.3			;THERE AREN'T ANY
		HLRZS	P1			;[1174] GET ALLOC'S IN RH
 REP 16/137	;08C67
		$TEXT	(CATTYO,<^W/.CTVSN(P4)/ is allocated by ^D/P1/ ^T/(S1)/>)
 WIT
		$TEXT	(CATTYO,<Old ^W/.CTVSN(P4)/ is allocated by ^D/P1/ ^T/(S1)/^0>) ;[1174]
 INS 35/150	;08C68
		;Routine to copy VSL request dependent data from MDR to VSL
		;Call:	AP = MDR address
		;	S1 = VSL address

	MDR2VS:	MOVE	TF,.MRPID(AP)		;[1173] MOVE REQUEST DEPENDENT
		MOVEM	TF,.VSPID(S1)		;[1173] DATA TO VSL
		MOVE	TF,.MRACK(AP)		;[1173] ..
		MOVEM	TF,.VSACK(S1)		;[1173] ..
		MOVE	TF,.MRFLG(AP)		;[1173] ..
		MOVEM	TF,.VSRFL(S1)		;[1173] ..
		$RETT				;[1173] RETURN

 REP 33/151	;08C69
	MDAE.2:	$WTO	(<^T/@MDAERS-1(S1)/>,<User: [SYSTEM] for ^15/.MRFLG(AP),MR.QUE/ request #^D/TF/^M^JVolume Set:^T/.VSVSN(S2)/  Volid:^W/.VLNAM(T1)/  Request-ID: ^D/.VSRID(S2),VS.RID/>,MDAOBJ)
 WIT
	MDAE.2:	$WTO	(<^T/@MDAERS-1(S1)/>,<User: [SYSTEM] for ^15/.VSRFL(S2),MR.QUE/ request #^D/TF/^M^JVolume Set:^T/.VSVSN(S2)/  Volid:^W/.VLNAM(T1)/  Request-ID: ^D/.VSRID(S2),VS.RID/>,MDAOBJ) ;[1173]
 INS 38/160	;08C70
		MOVX	S1,VS.DPR		;[1164] GET DEFAULT PROTECTION BIT
		IORM	S1,.VSATR(P2)		;[1164] LITE IT IN ATTRIBUTE WORD
 INS 26/164	;08C71
		MOVX	S1,VS.DPR		;[1164] GET DEFAULT PROTECTION BIT
		ANDCAM	S1,.VSATR(P2)		;[1164] TURN IT OFF
 REP 9/180	;08C72
	D$INID:: MOVX	S1,.RECDV		;GET THE BLOCK TYPE TO LOOK FOR
 WIT
	D$INID::PUSHJ	P,.SAVET		;[1164] SAVE T1-T4
		MOVX	S1,.ORREQ		;[1164] GET BLOCK TYPE TO LOOK FOR
		PUSHJ	P,A$FNDB##		;[1164] FIND IT
		SKIPF				;[1164] OLD PULSAR PERHAPS?
		SKIPA	T1,(S1)			;[1164] GET REQUEST ID
		MOVEI	T1,0			;[1164] ASSUME NO REQUEST-ID
		MOVX	S1,.RECDV		;GET THE BLOCK TYPE TO LOOK FOR
 INS 15/180	;08C73
		MOVE	T2,S1			;[1164] SAVE UCB ADDRESS
 INS 19/180	;08C74
		JUMPN	T1,DIND.1		;[1164] IF REQ ID THERE, IT'S REINIT
 INS 23/180	;08C75
	;[1164] Here when reinitialization complete (/NEW-VOLUME).
	;[1164] T1 = Request-id, T2 = UCB address

	DIND.1:	HRRZ	S1,T1			;[1164] GET RID WITHOUT POSSIBLE ERROR BIT
		PUSHJ	P,FNDVSL		;[1164] GO FIND THIS GUY'S VSL
		JUMPF	.RETT			;[1164] COULD HAVE BEEN CANCELLED
		MOVE	T3,S1			;[1164] SAVE VSL ADDR
		MOVE	S1,.VSVOL(T3)		;[1164] GET VOL BLOCK ADDR FOR 1ST VOL
		SKIPE	.VLUCB(S1)		;[1164] BARF IF VOL NOT MOUNTED
		CAME	T2,.VLUCB(S1)		;[1164] OR WRONG UCB
		  $STOP	(MWL,<Missing or Wrong VOL/UCB Link>) ;[1164] PLEASE,,NO!!
		MOVX	S1,VS.INI		;[1164] GET REINIT-IN-PROGRESS BIT
		TDNN	S1,.VSFLG(T3)		;[1164] WAS IT LIT IN VSL?
		  $STOP	(NVC,<NEW-VOLUME Code not working>) ;[1164] @$##@#!!
		ANDCAM	S1,.VSFLG(T3)		;[1164] CLEAR BIT IN VSL FLAG WORD
		MOVE	S1,T3			;[1164] GET VSL ADDRESS
		PUSHJ	P,SETAWT		;[1164] SET STATUS TO 'WAITING'
		LOAD	S1,.MSFLG(M),AK.NAK	;[1164] GET NACK BIT
		JUMPN	S1,DIND.2		;[1164] JUMP IF PULSAR IS UPSET
		DMOVE	S1,T2			;[1164] GET S1 = UCB ADDR, S2 = VSL ADDR
		PUSHJ	P,REASSIGN		;[1164] REASSIGN DRIVE TO USER!
		JUMPF	.RETT			;[1164] RETURN IF REASSIGN FAILS
		MOVE	S1,T3			;[1164] GET VSL ADDR
		PJRST	ACKUSR			;[1164] TELL USER GOOD NEWS

	;[1164] Here when operator said ABORT to PULSAR's WTOR to mount a tape

	DIND.2:	$SAVE	<P4>			;[1164] SAVE P4
		MOVEI	P4,[ASCIZ\Operator aborted WTOR sent by tape labeler\] ;[1164]
		MOVE	S1,.VSVOL(T3)		;[1164] GET ADDRESS OF 1ST VOL BLOCK
		PUSHJ	P,VLBREAK		;[1164] BREAK THE VOL/UCB LINK
		MOVE	S1,T3			;[1164] GET VSL ADDR
		PJRST	DELREQ			;[1164] GO DELETE REQUEST

	;[1164] Set vol status to 'waiting' after reinit is done.
	;
	;	Call:	S1 = VSL address

	SETAWT:	LOAD	S2,.VSCVL(S1),VS.CNT	;[1164] GET NUMBER OF VOLS IN THE VSN
		MOVNS	S2			;[1164] NEGATE IT
		HRLI	S2,.VSVOL(S1)		;[1164] GET ADDRESS OF FIRST VOL	PTR
		MOVSS	S2			;[1164] MAKE AN AOBJN POINTER
		MOVEI	TF,%STAWT		;[1164] STATUS CODE FOR 'WAITING'

	SETA.1:	MOVE	S1,(S2)			;[1164] GET A VOL BLOCK ADDR
		STORE	TF,.VLFLG(S1),VL.STA	;[1164] RESET STATUS TO WAITING
		AOBJN	S2,SETA.1		;[1164] LOOP THROUGH ALL VOL BLOCKS
		$RETT				;[1164] RETURN

 INS 23/183	;08C76
		MOVE	T3,S1			;[1173] SAVE VSL ADDRESS
 INS 34/183	;08C77
		MOVE	S1,T3			;[1173] GET VSL ADDRESS BACK
		SETZM	S2			;[1173] USE VSL ACK DATA
 INS 20/205	;08C78
		LOAD	S1,.VSFLG(P1),VS.NEW	;[1164] /NEW-VOLUME REINT?
		JUMPN	S1,MODR.0		;[1164] ..JUMP IF SO
 REP 30/205	;08C79
		LOAD	S1,.VSATR(P1),VS.DEN	;GET THE REQUESTED DENSITY
 WIT
	MODR.0:	LOAD	S1,.VSATR(P1),VS.DEN	;[1164] GET THE REQUESTED DENSITY
 SUM 150122