DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41

TABLE OF CONTENTS



    23-   43	PURE DATA

    23-   58	IMPURE DATA

    25-  113	MAIN PARSER ROUTINE

    26-  187	PARSER STATE TABLE

    27-  342	ACTION ROUTINES

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 3





      1	000000					$BEGIN	DSCPAR,0033,<COMMAND PARSER FOR DSC UTILITY>

						.TITLE	DSCPAR	X0033 - COMMAND PARSER FOR DSC UTILITY

						.IDENT	"X0033"

      2

      3					; ALTERED:

      4					; GEORGE RITTENBURG  24-SEP-76  15:47

      5					;

      6					; COPYRIGHT (C) 1976 BY DIGITAL EQUIPMENT CORPORATION,

      7					; MAYNARD, MASSACHUSETTS

      8					;

      9					; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A

     10					; SINGLE  COMPUTER  SYSTEM AND MAY BE COPIED ONLY WITH THE IN-

     11					; CLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE,  OR

     12					; ANY  OTHER  COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE

     13					; MADE AVAILABLE TO ANY OTHER PERSON EXCEPT FOR  USE  ON  SUCH

     14					; SYSTEM  AND TO ONE WHO AGREES TO THESE LICENSE TERMS.  TITLE

     15					; TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL  TIMES  REMAIN

     16					; IN DIGITAL.

     17					;

     18					; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITH-

     19					; OUT  NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY

     20					; DIGITAL EQUIPMENT CORPORATION.

     21					;

     22					; DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY  FOR

     23					; THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT WHICH IS

     24					; NOT SUPPLIED BY DIGITAL.

     25					;

     26					; ANDREW C. GOLDSTEIN  19-NOV-76  1:24

     27					; GEORGE RITTENBURG	11-MAR-77  001 CONDITIONAL FOR 11D AND IAS INSERTED

     28					;G.RITTENBURG	6-APR-77 MODIFIED FOR VFY/CMP DISK TO/FROM TAPE

     29					; G.RITTENBURG 12-SEPT.77 SUPPORT FOR RM03 AND RL01 ADDED

     30					; G.RITTENBURG  9-NOV-77 SUPPORT FOR DF AND DS DEVICES REMOVED FOR

     31					; STAND ALONE VERSION ONLY

     32

     33

     34						.MCALL	ALUN$S,QIOW$C,GLUN$C,GTSK$C

     35						.MCALL  QIO$S,WTSE$S,NMBLK$,DIR$

     36	000000					NMBLK$

     37		000000 			RPCS=0

     38		177774 			RPDS=-4

     39		000010 			RSCS2=10

     40		000026 			RSDT=26

     41		000050 			XSTSIZ=40.				; SIZE OF EXPANDED STRING AREA.

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 4

PURE DATA



     43						.SBTTL	PURE DATA

     44

     45					;

     46					;

     47	000000						.PSECT PARDAT,D

     48					;

     49					; PROMPT STRING TO GET COMMAND LINE

     50					;

     51	000000	   104 	   123 	   103 	PROMPT:	.ASCII	"DSC>"

	000003	   076

     52		000004 			PROMPL	= .-PROMPT

     53

     54						.EVEN

     55

     56

     57

     58						.SBTTL	IMPURE DATA

     59

     60					;

     61					; SCRATCH STORAGE FOR THE PARSER

     62					;

     63	000004				VNUM:	.BLKW	1		; POINTER TO VOLUME COUNT WORD

     64	000006				DEVPT:	.BLKW	1		; POINTER TO VOLUME TABLE

     65	000010				CML::	.BLKW	1		; POINTER TO START OF COMMAND LINE

     66					.IF  DF,R$$11S

     67

     68						.MACRO  TABENT   DEV

     69							.ASCII  /'DEV'/

     70							.WORD   $'DEV'INT	; 'DEV' INTERUPT ADDRESS

     71						.ENDM	TABENT

     72

     73					INTADD:		.BLKW		1	;DEV. INTERUPT ADDRESS TABLE

     74					MMDEV:  .ASCII /MM/

     75					DEVTAB:	TABENT	DK

     76						TABENT  DM

     77					; THE FOLLOWIN CONDITIONAL INSERTED N0V.9,1977

     78							.IF DF,R$SPEC

     79							  TABENT  DF

     80							  TABENT  DS

     81							.ENDC

     82						TABENT	DP

     83						TABENT	DB

     84						TABENT	MT

     85						TABENT	MM

     86						TABENT  DL

     87						TABENT  DR

     88					DEVEND:

     89					.ENDC

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 5

IMPURE DATA



     91					;

     92					; DIRECTIVE PARAMETER BLOCK FOR LOGICAL NAME TRANSLATION.

     93					;

     94	000012	   221 	   010 		LNDPB:	.BYTE	145.,8.			; DIRECTIVE CODE & DPB SIZE.

     95	000014	000003 				.WORD	3			; USE RMS MODE.

     96	000016	000000 				.WORD	0			; NO LUN.

     97	000020	000000G				.WORD	.PSTCN			; ADDR OF TPARS SCANNED STRG DESC.

     98	000022	000000 				.WORD	0			; DEFAULT NAME STRING NOT USED.

     99	000024	000000 				.WORD	0			; MUST BE ZERO.

    100	000026	000032'				.WORD	FNB			; ADDR OF FILE NAME BLOCK.

    101	000030	000140'				.WORD	EXPSTG			; ADDR OF EXPANDED STRING DESC.

    102					;

    103					; FILE NAME BLOCK.

    104					;

    105	000032				FNB:	.BLKB	N.UNIT+2

    106					;

    107					; EXPANDED STRING AREA AND DESCRIPTOR FOR SAME.

    108					;

    109	000070				XPSTG:	.BLKB	XSTSIZ			; EXPANDED STRING AREA.

    110	000140	000000 			EXPSTG:	.WORD	0			; SIZE OF ABOVE AREA.

    111	000142	000070'				.WORD	XPSTG			; ADDR OF EXPANDED STRING AREA.

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 6

MAIN PARSER ROUTINE



    113						.SBTTL	MAIN PARSER ROUTINE

    114

    115					;+

    116					;

    117					;

    118	000036						.PSECT

    119					;

    120					; *** - $DSCPR - DSC COMMAND LINE PARSER

    121					;

    122					; THIS ROUTINE ACCEPTS A COMMAND LINE (FROM THE TERMINAL OR MCR

    123					; COMMAND BUFFER), PARSES IT, AND LEAVES THE RESULTS IN THE

    124					; PARSER OUTPUT AREA.

    125					;

    126					; INPUTS:	NONE

    127					;

    128					; OUTPUTS:	AS DOCUMENTED IN THE DSC IMPURE AREA

    129					;

    130					;-

    131

    132	000036				$DSCPR::

    133					;

    134					; ACQUIRE A COMMAND LINE

    135					;

    136	000036					$CALL	.GTCML <,,,#PROMPL,#PROMPT>

    137	000052					IF R3 EQ #0 GOTO $DSCPR		; IGNORE NULL LINES

    138	000056					LET CML := R4			; SAVE COMMAND LINE ADDRESS

    139					;

    140					; NOW CALL THE PARSER

    141					;

    142	000062					LET $IFLAG := #KY.MRG		; INITIAL FLAG VALUE

    143	000070					$CALL	.TPARS <,#0,#DSCKTB,R3,R4,#START>

    144	000110					ON.ERROR

    145	000112						LET R4 := R4 + .PSTCN	; R4 POINTS TO REMAINDER OF STRING

    146	000116						ERROR   ER.SYN		; SYNTAX ERROR

    147	000120					END

    148

    149						.IF DF,  R$$11S

    150						IF #KY.NCP SET.IN $FLAG1

    151						  TST (SP)+			; NON-COPY OPERATION

    152						  JUMPTO $DSC

    153						END

    154					;CURRENT COMMAND WAS TO SET HDWRE. SWITCHES.

    155					;

    156						.ENDC

    157	000120				IF  $IVNUM EQ #0 THEN ERROR ER.SYN  ;CHECK FOR NO INPUT DEV.

    158					;

    159					;CHECK FOR CONSISTENT SWITCHES

    160					;

    161	000130					LET R0 := $IFLAG

    162	000134					IF #KY.TAP SET.IN R0

    163	000142					  LET R0 := R0 OFF.BY #KY.ITP

    164	000146					ELSE

    165	000150					  LET R0 := R0 OFF.BY #KY.IDK

    166	000154					END

    167	000154					LET R1 := $OFLAG

    168	000160					IF #KY.TAP SET.IN R1

    169	000166					  LET R1 := R1 OFF.BY #KY.OTP

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 6-1

MAIN PARSER ROUTINE



    170	000172					ELSE

    171	000174					  LET R1 := R1 OFF.BY #KY.ODK

    172	000200					END

    173	000200					LET R0 := R0 SET.BY R1

    174	000202					IF RESULT IS NE THEN ERROR ER.ILS

    175	000206					   LET $FLAG1 := $FLAG1 SET.BY #40000

    176	000214					   IF #KY.TAP OFF.IN $OFLAG

    177	000224						LET $FLAG1 := $FLAG1 OFF.BY #40000

    178	000232					   END

    179	000232					   IF #KY.TAP SET.IN $IFLAG

    180	000242					       LET $FLAG1 := $FLAG1 SET.BY #100000

    181	000250					   END

    182	000250					   IF #KY.VER SET.IN $OFLAG OR #KY.CMP SET.IN $OFLAG

    183	000270						   IF  $FLAG1 EQ #140000 THEN ERROR ER.ILS

    184	000302					   END

    185	000302					RETURN

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 7

PARSER STATE TABLE



    187						.SBTTL	PARSER STATE TABLE

    188

    189						.MCALL	ISTAT$,STATE$,TRAN$

    190

    191	000304					ISTAT$	DSCSTB,DSCKTB

    192					;

    193					; INIT FOR OUTPUT DEVICES

    194					;

    195	000304					STATE$	START

    196	000304					TRAN$	$LAMDA,,IODEV

    197					;

    198					; READ OUTPUT DEVICE LIST

    199					;

    200	000304					STATE$

    201	000304					TRAN$	!DEVLST

    202					;

    203					; READ "=" AND INIT FOR INPUT DEVICES

    204					;

    205	000304					STATE$

    206	000304					TRAN$	$EOS,$EXIT

    207	000304					TRAN$	'=,,IIDEV

    208					;

    209					; READ INPUT DEVICE LIST

    210					;

    211	000304					STATE$

    212	000304					TRAN$	!DEVLST

    213

    214	000304					STATE$

    215	000304					TRAN$	$EOS,$EXIT

    216					;

    217					; SUBEXPRESSION TO READ LIST OF DEVICE NAMES

    218					;

    219	000304					STATE$	DEVLST

    220	000304					TRAN$	$STRNG,,LOGNAM		;DEVICE NAME/UNIT, OR LOGICAL NAME.

    221

    222	000304					STATE$	DEV1

    223	000304					TRAN$	':			; DEVICE SPEC ENDS WITH COLON

    224

    225	000304					STATE$

    226	000304					TRAN$	<',>,DEVLST		; LOOP FOR MULTIPLE DEVICES

    227	000304					TRAN$	'/,OPTS			; SWITCHES

    228	000304					TRAN$	$STRNG,OPTS1,SETLAB	; LABEL STRING

    229	000304					TRAN$	$LAMDA,$EXIT

    230					;

    231					; OPTION PROCESSING

    232					;

    233	000304					STATE$	OPTS1

    234	000304					TRAN$	'/,OPTS			; GET NEXT SWITCH

    235	000304					TRAN$	$LAMDA,$EXIT

    236

    237	000304					STATE$	OPTS

    238	000304					TRAN$	"RW",OPTS1,,KY.RWD,$IFLAG	; REWIND

    239	000304					TRAN$	"DENS",DENS			; TAPE DENSITY

    240	000304					TRAN$	"AP",OPTS1,,KY.APD,$IFLAG	; APPEND

    241	000304					TRAN$	"NMG",OPTS1,SETNMG		; NO MERGE

    242	000304					TRAN$	"BAD",BAD			; BAD BLOCK PROCESSING

    243	000304					TRAN$	"VE",OPTS1,,KY.VER,$IFLAG	; VERIFY AFTER COPY

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 7-1

PARSER STATE TABLE



    244	000304					TRAN$	"CMP",OPTS1,,KY.CMP,$IFLAG	; COMPARE ONLY

    245					.IF  DF,R$$11S

    246

    247					TRAN$	"UNIT",USTAT

    248					TRAN$	"VEC",VSTAT

    249					TRAN$	"CSR",CSTAT

    250					TRAN$	"TM02",TSTAT

    251

    252					STATE$ USTAT

    253					TRAN$ '=

    254

    255					STATE$

    256					TRAN$	$NUMBR,HWDOP,STUNI

    257

    258					STATE$	VSTAT

    259					TRAN$	'=

    260

    261					STATE$

    262					TRAN$	$NUMBR,HWDOP,STVEC

    263

    264					STATE$ CSTAT

    265					TRAN$	'=

    266

    267					STATE$

    268					TRAN$	$NUMBR,HWDOP,STCSR

    269

    270					STATE$ TSTAT

    271					TRAN$	'=

    272

    273					STATE$

    274					TRAN$		$NUMBR,HWDOP,STTM2

    275

    276					STATE$ HWDOP

    277					TRAN$	'/,HWD1

    278					TRAN$	$EOS,$EXIT

    279

    280					STATE$  HWD1

    281					TRAN$	"UNIT",USTAT

    282					TRAN$	"VEC",VSTAT

    283					TRAN$	"CSR",CSTAT

    284					TRAN$	"TM02",TSTAT

    285

    286					.ENDC

    287					;

    288					; SET TAPE DENSITY

    289					;

    290	000304					STATE$	DENS

    291	000304					TRAN$	'=

    292

    293	000304					STATE$

    294	000304					TRAN$	"800",DENS1

    295	000304					TRAN$	"1600",OPTS1,,KY.160!KY.16B,$IFLAG

    296

    297	000304					STATE$	DENS1

    298	000304					TRAN$	':

    299					;

    300					; SET SPLIT DENSITY

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 7-2

PARSER STATE TABLE



    301					;

    302	000304					STATE$	DENS3

    303	000304					TRAN$	"1600",OPTS1,SET16B

    304					;

    305					; BAD BLOCK PROCESSING SWITCHES

    306					;

    307	000304					STATE$	BAD

    308	000304					TRAN$	'=

    309

    310	000304					STATE$	BAD1

    311	000304					TRAN$	"MAN",BAD2,,KY.MAN,$IFLAG

    312	000304					TRAN$	"NOAUTO",,,KY.NAU,$IFLAG

    313

    314	000304					STATE$	BAD2

    315	000304					TRAN$	':,BAD1

    316	000304					TRAN$	$LAMDA,OPTS1

    317

    318					;

    319					; PROCESS THE TRANSLATED DEVICE NAME.

    320					;

    321	000304					STATE$	DNSYN			; DEVICE NAME UNIT SYNTAX.

    322	000304					TRAN$	$ALPHA,,SETDEV		; FIRST DEV NAME CHAR

    323

    324	000304					STATE$

    325	000304					TRAN$	$ALPHA,,SETDEV		; 2ND CHAR

    326

    327	000304					STATE$

    328	000304					TRAN$	$LAMDA,,INIUNI		; INITIALIZE UNIT NUMBER TO ZERO.

    329

    330	000304					STATE$

    331	000304					TRAN$	$ALPHA,UNIT,SETCON	; SET CONTROLLER OFFSET IF ANY.

    332	000304					TRAN$	$LAMDA			; CONTROLLER LETTER IS OPTIONAL.

    333

    334	000304					STATE$	UNIT

    335	000304					TRAN$	$NUMBR,COLON,SETUNT	; UNIT NUMBER (AND DEVICE SETUP)

    336	000304					TRAN$	$LAMDA,,SETU0

    337

    338	000304					STATE$	COLON

    339	000304					TRAN$	':,$EXIT

    340	000304					STATE$

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 8

ACTION ROUTINES



    342							.SBTTL  ACTION ROUTINES

    343					;

    344					; ACTION ROUTINE TO ATTEMPT TRANSLATION OF A LOGICAL NAME.

    345					;

    346	000304				LOGNAM:

    347	000304					LET	EXPSTG  :=  #XSTSIZ	; SET EXPANDED STRING SIZE.

    348	000312					LET	.PSTCN  :=  .PSTCN  +  #1  ; PASS COLON TO DIRECTIVE.

    349	000316					DIR$	#LNDPB			; ELEPHANT DIRECTIVE.

    350	000324					LET	.PSTCN  :=  .PSTCN  -  #1  ; READJUST FOR MAINLINE PARSE.

    351	000330					PUSH	 R3,R4,R5		; SAVE TPARS CONTEXT.

    352	000336					$CALL	 .TPARS	 <,#0,#DSCKTB,EXPSTG,EXPSTG+2,#DNSYN>

    353	000366					POP	 R5,R4,R3		; RESTORE TPARS CONTEXT.

    354	000374					ON.NOERROR  GOTO  XITNRM

    355					;

    356					; IF THE DIRECTIVE FAILED, REJECT THE TRANSITION (SYNTAX ERROR).

    357					;

    358	000376	062716 	000002 			ADD	#2,(SP)			; RETURN @ CALL PLUS 4.

    359	000402				XITNRM:	RETURN

    360

    361

    362					;

    363					; SET UP FOR OUTPUT DEVICES

    364					;

    365	000404				IODEV:	LET DEVPT := #$OVTAB

    366	000412					LET VNUM := #$OVNUM

    367	000420					RETURN

    368					;

    369					; SET UP FOR INPUT DEVICES

    370					;

    371	000422				IIDEV:	LET DEVPT := #$IVTAB

    372	000430					LET VNUM := #$IVNUM

    373	000436					LET $OFLAG := $IFLAG

    374	000444					LET $IFLAG := #0

    375	000450					RETURN

    376					;

    377					; GET DEVICE NAME CHAR

    378					;

    379	000452				SETDEV:	IF @VNUM GE #V.LENG THEN ERROR ER.TMD

    380	000464					LET @DEVPT :B= .PCHAR

    381	000472					LET DEVPT := DEVPT + #1

    382	000476					RETURN

    383					;

    384					; INITIALIZE UNIT NUMBER TO ZERO.

    385					;

    386	000500				INIUNI:	LET  @DEVPT  :=  #0

    387	000504					RETURN

    388					;

    389					; ADJUST UNIT NUMBER BY CONTROLLER OFFSET.

    390					; OFFSET EQU ((CONTROLLER LETTER - #101) * 16.)

    391					;

    392	000506				SETCON:	LET  R0  :=  .PCHAR  -  #101	; A=0,B=1,C=2 ETC.

    393	000516					LET  R0  :=  R0  L.SHIFT 4	; MULTIPLY BY 16.

    394	000526					LET  @DEVPT  :=  R0		; STORE UNIT NUMBER.

    395	000532					RETURN

    396					;

    397					;GET UNIT NUMBER AND SET UP DEVICE

    398					;

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 8-1

ACTION ROUTINES



    399					.IF DF,R$$11S

    400					SETUNT: IF .PNUMB GT #1 THEN ERROR ER.ILU

    401					;STANDALONE MAX. IS 2 DEVICES

    402						LET @DEVPT  := .PNUMB

    403

    404					.IFF

    405	000534	066777 	000000G	000006'	SETUNT:	ADD	.PNUMB,@DEVPT		; ADD UNIT NUMBER TO CONTROLLER OFFSET.

    406					.ENDC

    407

    408	000542				SETU0:	LET R0 := DEVPT - #2

    409	000552					LET R1 := R0 - #V.SIZ		; POINT TO PREVIOUS TABLE ENTRY

    410	000560					WHILE R1 HI VNUM		; SCAN PRECEDING ENTRIES

    411	000566					IF (R0) EQ (R1) AND 2(R0) EQ 2(R1) THEN ERROR ER.DUD

    412	000604					  LET R1 := R1 - #V.SIZ		; FOR DUPLICATES

    413	000610					END LOOP

    414	000612					ALUN$S #INLUN,(R0),2(R0)

    415	000632					ON.ERROR THEN ERROR ER.DEV

    416	000636					GLUN$C INLUN,$LUNBF

    417

    418						.IF   DF, R$$11D		;001 CONDITIONAL FOR 11D AND IAS

    419

    420						CALL	$FILCW			;001

    421

    422						.ENDC				;001

    423	000644					LET $CW2+1 :B= #0  ;CLEAR HI BYTE  12-9-77

    424

    425	000650					IF #DV.SQD SET.IN $CW1

    426	000660					  LET $IFLAG := $IFLAG SET.BY #KY.TAP

    427	000666					  IF #KY.DSK SET.IN $IFLAG THEN ERROR ER.CDV

    428	000700					  LET R1 := R0 - #V.SIZ		; POINT TO PREVIOUS TABLE ENTRY

    429	000706					  IF @VNUM NE #0		; IF THERE IS ONE

    430	000714					    IF (R1) NE (R0) THEN ERROR ER.MXT ; CHECK FOR MIXED TAPE DRIVS

    431	000722					  END

    432						.IF	DF,R$$11S

    433						  $CALL LOCUCB			;TO GET UCB ADDRESS

    434						GOTO SIZE

    435						.IFF

    436	000722					  JUMPTO CONT3

    437						.ENDC

    438	000726					END

    439	000726					IF #DV.F11 OFF.IN $CW1 THEN ERROR ER.F11

    440						.IF	DF,R$$11S

    441						$CALL LOCUCB		;TO GET UCB ADDR. IN R2

    442					SIZE:	PUSH R3			;SAVE R3

    443						LET R3 := U.SCB(R2)	;R3 IS SCB ADDR

    444						LET U.ST2(R2) :B= U.ST2(R2) OFF.BY #US.OFL  ;SET DEV ON LINE

    445						LET R3 := S.CSR(R3)	;R3 IS CSR ADDR

    446						PUSH  @#4		;SAVE INTRPT ADDR

    447						LET @#4 := #TRAPA	;SET NEW INTRPT ADDR

    448						LET PS :B= #PR7		;LOCK OUT INTRPTS

    449						TST  (R3)		;IS CTRLR THERE?

    450						BCC  DEVCK		;YES BRANCH

    451						LET U.ST2(R2) :B= U.ST2(R2) SET.BY #US.OFL  ;SET DEV OFF LINE

    452						POP  @#4		;RESTORE INTRPT ADDR

    453						LET PS :B= #0		;ENABLE INTRPTS

    454						POP R3			;RESTORE R3

    455						JUMPTO CONT3

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 8-2

ACTION ROUTINES



    456					DEVCK:	POP @#4    ;		RESTORE INTRPT ADDR

    457						LET PS :B= #0		;ENABLE INTRPTS

    458						IF #DV.SQD SET.IN $CW1

    459							POP R3	;IF TAPE RESTORE R3

    460							JUMPTO CONT3  ;AND EXIT

    461						END

    462					;

    463					; THE FOLLOWING CONDITIONAL INSERTED NOV.9,1977

    464					;

    465						.IF  DF,R$SPEC

    466					;

    467						CMP	(R0),#"DF	;IS IT A DF DEV?

    468						BNE	DSDEV		;NO,TRY DS DEV

    469						MOV	U.CW3(R2),R3	;YES, R3 IS BLOCKS PER PLATTER

    470							;READ FIRST BLOCK ON NEXT PLATTER

    471					RPTRD: QIO$S #IO.RLB,#INLUN,#EFN,,#$B1HD,,<#$B1DAT,#256.,,#0,R3>

    472							BCS	QIOER			;COMMAND REJECTED BY QIO

    473						WTSE$S  #EFN			;WAIT

    474						TSTB	$B1HD		;	TEST FOR ERROR

    475						BMI	ILBLK			;TO TEST FOR ILLEGAL BLOCK

    476						ADD	U.CW3(R2),R3		;BUMP R3 TO NEXT PLATTER

    477						BR	RPTRD			;TRY NEXT PLATTER

    478					QIOER: ERROR ER.UDE			;QIO REJECT

    479					ILBLK:	CMPB	#IE.BLK,$B1HD		;TEST FOR ILLEGAL BLOCK

    480						BEQ	SETDF		;YES, SET FOR DF DEV

    481						IF #IE.OFL SET.IN $B1HD THEN ERROR ER.DEV

    482						ERROR ER.UDE

    483					SETDF:	CLR	$CW2		;SET HI WORD OF LBN TO 0B,

    484						MOV	R3,$CW3		;SET MAX. BLOCKS FROM R3

    485						JMP	LVSIZ			;GO TO EXIT

    486					DSDEV:	CMP	(R0),#"DS	; DS DEVICE?

    487						BNE	RPDEV		; NO, TRY DP

    488						MOV	#40,10(R1)	; CLEAR DS SUB-SYSTEM

    489						MOVB	U.UNIT(R2),RSCS2(R1)  ; YES, SELECT UNIT

    490						MOV	 #1024,U.CW3(R2)	;SET UP FOR RS03

    491						CLR	U.CW2(R2)

    492						BIT	#10000,RSCS2(R1)	; IS DEVICE THERE?

    493						BEQ	10$			; YES, BRANCH

    494						BISB	#US.OFL,U.ST2(R2)	; SET DEVICE OFF LINE

    495						BR	MAINXT

    496					10$:	BIT	#2,RSDT(R1)		; DEVICE IS RS04?

    497						BEQ	MAINXT			; NO, GO TO EXIT

    498						ASL	U.CW3(R2)		; DOUBLE NO. OF BLOCKS

    499						BIS	#U2.R04,U.CW2(R2)	; SET RS04 BIT

    500						BR	MAINXT			; AND EXIT

    501						.ENDC

    502

    503					RPDEV:	MOV	U.SCB(R2),R1		;R1 HAS SCB ADDRESS

    504						MOV	S.CSR(R1),R1		;R1 HAS CSR ADDRESS

    505						CMP	(R0),#"DP		;DP DEVICE?

    506						BNE	DBDEV			;TRY DB DEVICE

    507						MOV	#40000.,U.CW3(R2)	;SET UCB FOR RP02

    508						CLR	U.CW2(R2)

    509						MOVB	U.UNIT(R2),R3

    510						SWAB	R3

    511						MOV	R3,RPCS(R1)	;	SELECT UNIT

    512						BIT	#20000,RPDS(R1)		;TESTFOR RP03

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 8-3

ACTION ROUTINES



    513

    514						BEQ MAINXT		;NO,GO TO EXIT

    515						ASL	U.CW3(R2)		;DBLE BLKS IN UCB

    516						ROLB	U.CW2(R2)

    517						BR	MAINXT			;TO EXIT

    518					DBDEV:	CMP	(R0),#"DB		;DB DEVICE?

    519						BNE	DMDEV			;NO TRY DM

    520						MOV	#40,10(R1)	;CLEAR DB SUB-SYSTEM

    521						MOVB	U.UNIT(R2),RSCS2(R1)	;SELECT UNIT

    522						MOVB	#2,U.CW2(R2)		;SET FOR RP04/05

    523						MOV	#117426,U.CW3(R2)

    524						BIT  #10000,RSCS2(R1)	;IS DEV THERE

    525						BEQ  10$		;YES,BRANCH

    526						BISB  #US.OFL,U.ST2(R2)   ;SET DEV OFF LINE

    527						BR  MAINXT

    528					10$:	BIT	#2,RSDT(R1)		;TEST FOR RP06

    529						BEQ	MAINXT		;NO GO TO EXIT

    530						MOVB	#5.,U.CW2(R2)		;SET FOR RP06 IN

    531						MOV	#12990.,U.CW3(R2)	;UCB

    532						BR	MAINXT			;GO TO EXIT

    533					DMDEV:

    534						CMP 	(R0),#"DM		;DM DEVICE?

    535						BNE	DRDEV			;NO, TRY DR

    536						MOV	#40,10(R1)		;CLEAR RK06 SUB-SYSTEM

    537						MOV	2(R0),10(R1)		;LOAD UNIT NO.

    538						MOV	#1,(R1)			;SELECT DRIVE

    539					10$:	TSTB	(R1)			;WAIT FOR SERIAL MSG.

    540						BPL	10$

    541						BICB	#US.OFL,U.ST2(R2)	;ASSUME ON-LINE

    542						BIT	#10000,10(R1)		;DRIVE THERE ?

    543						BEQ	20$			;IF EQ,YES

    544						BISB	#US.OFL,U.ST2(R2)	;NO,SET OFF-LINE

    545						BR	MAINXT

    546					20$:	MOV	#64766,U.CW3(R2)	;ASSUME RK06

    547						BIT  	#400,12(R1)		;RK06 ?

    548						BEQ	MAINXT			;IF EQ, YES

    549						MOV	#151036,U.CW3(R2)	;NO, ITS RK07

    550						BR	MAINXT

    551					DRDEV:	CMP	(R0),#"DR		;DR DEVICE ?

    552						BNE	MAINXT			;NO, EXIT

    553						MOV	#40,10(R1)		;CLEAR MASSBUS CNTRLR

    554						MOV	2(R0),10(R1)		;LOAD UNIT NO.

    555						MOV	26(R1),R3		;SELECT UNIT

    556						BICB	#US.OFL,U.ST2(R2)	;ASSUME ON-LINE

    557						BIT	#10000,10(R1)		;DEVICE THERE ?

    558						BEQ	MAINXT			;NO, EXIT

    559						BISB	#US.OFL,U.ST2(R2)	;SET OFF-LINE

    560					MAINXT:	MOVB	U.CW2(R2),$CW2		;STORE DEV.SIZE

    561						MOV	U.CW3(R2),$CW3

    562						GOTO LVSIZ

    563					TRAPA:   LET 2(SP) := 2(SP) SET.BY #1	;SET C BIT

    564						RTI				;AND RETURN

    565					LVSIZ:	POP	R3			;RESTORE R3

    566						.ENDC

    567	000740				 	  LET $IFLAG := $IFLAG SET.BY #KY.DSK

    568	000746					  IF #KY.TAP SET.IN $IFLAG THEN ERROR ER.CDV

    569	000760					  LET V.FRBK(R0) := $CW3

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 8-4

ACTION ROUTINES



    570	000766					  LET V.FRBK+2(R0) :B= $CW2

    571

    572	000774				CONT3:

    573	000774					LET DEVPT := DEVPT + #V.SIZ-2

    574	001002					LET @VNUM := @VNUM + #1

    575	001006					RETURN

    576					;

    577					; STORE LABEL STRING

    578					;

    579	001010				SETLAB:	LET R0 := .PSTCN		; GET BYTE COUNT

    580	001014					IF R0 GT #12. THEN ERROR ER.LAB

    581	001024					LET R1 := .PSTPT

    582	001030					LET R2 := VNUM			; ADDRESS OF LABEL BUFFER

    583	001034	005722 				TST (R2)+			; FOLLOWS UNIT COUNT

    584	001036					THRU R0

    585	001036					  LET (R2)+ :B= (R1)+		; COPY LABEL

    586	001040					END LOOP

    587	001044					LET R0 := #12. - .PSTCN		; COMPUTE UNUSED SPACE

    588	001054					IF RESULT IS GT

    589	001056					  THRU R0

    590	001056					    LET (R2)+ :B= #40		; PAD WITH BLANKS

    591	001062					  END LOOP

    592	001066					END

    593	001066					RETURN

    594					;

    595					; SET SPLIT TAPE DENSITY - 800/1600

    596					;

    597	001070				SET16B:	LET $IFLAG := $IFLAG SET.BY #KY.160

    598	001076					RETURN

    599					;

    600					; SET NO MERGE MODE

    601					;

    602	001100				SETNMG:	LET $OFLAG := $OFLAG OFF.BY #KY.MRG

    603	001106					LET $IFLAG := $IFLAG OFF.BY #KY.MRG

    604	001114					RETURN

    605

    606						.IF	DF,R$$11S

    607

    608					LOCUCB:	PUSH R3		;SAVE R3

    609						LET R1 :=	$DEVHD	;R1 POINTS AT 1ST DCB

    610						REPEAT

    611					CONT:

    612							IF (R0) EQ D.NAM(R1) LEAVE LOOP

    613							;THIS MAY BE CORRECT DCB

    614							LET R1 :=	D.LNK(R1)

    615							;R1 POINTS AT NEXT DCB

    616							IF R1 EQ #0 THEN ERROR ER.DEV

    617							;DEVICE NOT IN SYSTEM

    618						END LOOP

    619							IFB 2(R0) LO D.UNIT(R1) THEN GOTO CONT

    620							IFB 2(R0) HI D.UNIT+1(R1) THEN GOTO CONT

    621							;IF EITHER TEST FAILED,WRONG DCB

    622						LET R2 := D.UCB(R1)	;R2 POINTS AT 1ST UCB

    623						LET R3 :B= D.UNIT(R1)		;R3 IS LOW UNIT NO.

    624						NEG  R3				;R3 IS NEG. OF LOW UNIT NO.

    625						LET R3 := R3 + 2(R0)		;R3 IS REL. UNIT NO.

    626						REPEAT

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 8-5

ACTION ROUTINES



    627							IF  R3 EQ #0 LEAVE LOOP  ;CORRECT UCB

    628							LET R3 := R3 - #1	;DECR.R3

    629							LET R2 := R2 + D.UCBL(R1)	;NEXT UCB

    630						END LOOP

    631						LET $UCBAD := R2		;STORE UCB ADDRESS

    632						POP R3

    633						RETURN

    634					STUNI:

    635						LET R2 := $UCBAD	;R2 POINTS AT UCB

    636						LET U.UNIT(R2) :B= .PNUMB ;STORE UNIT NO.

    637						LET $FLAG1 := $FLAG1 SET.BY #KY.NCP ; SET NON-COPY COMMAND

    638						RETURN

    639					STVEC:

    640						IF .PNUMB HI #376 THEN ERROR ER.VEC

    641						LET R2 := .PNUMB

    642						LET R2 := R2 OFF.BY #177774 ;MULTIPLE OF 4?

    643						IF R2 NE #0 THEN ERROR ER.VEC

    644							;IF EITHER TEST FAILED,ILLEGAL VECTOR

    645						LET R1 := #DEVTAB

    646						LET R0 := DEVPT - #V.SIZ	;R0 POINTS AT DEV. NAME

    647						REPEAT

    648							IF (R0) EQ (R1)+ LEAVE LOOP ;R1 POINTS AT CORRECT

    649											;INTERUPT ADDRESS

    650						LET R1 := R1 + #2		;NEXT ENTRY IN TABLE

    651						IF R1 HI #DEVEND THEN ERROR ER.DEV

    652							;DEVICE NOT IN TABLE

    653						END LOOP

    654						LET INTADD := (R1)	;	STORE INTERRUPT ADDRESS

    655						PUSH R3

    656						LET R3 := $UCBAD

    657						LET R3 := U.SCB(R3)	;SCB ADDRESS

    658						LET R1 :B= S.VCT(R3)	;OLD VECT.ADDR./4

    659						LET R1 := R1 OFF.BY #177400

    660						LET R1 := R1 L.SHIFT 2	;ABSOLUTE ADDR

    661						LET R2 := .PNUMB	;R2 HAS NEW VECTOR

    662						LET (R1) := #$NONSI	;KILL INTERRUPT AT OLD ADDR

    663						LET (R2)  :=   INTADD ;STORE INT ADDR AT NEW VECTOR

    664						LET R2 := R2 R.SHIFT 2	;DIVIDE NEW VECT BY 4

    665						LET S.VCT(R3) :B= R2	;STORE NEW VECT IN SCB

    666						LET $FLAG1 := $FLAG1 SET.BY #KY.NCP ; SET NON-COPY COMMAND

    667						POP R3

    668						RETURN

    669					STCSR:

    670						LET R1 := $UCBAD	;UCB ADDRESS

    671						LET PS :B= #PR7

    672						;LOCK OUT INTRPTS

    673						PUSH @#4		;SAVE INTRPT ADDRESS

    674						LET @#4 := #CONT2		;SET TRAP ADDRESS

    675						TST @.PNUMB		;SEE IF DEV. IS THERE

    676						BCC CONT1

    677								;YES BRANCH

    678						LET U.ST2(R1) :B= U.ST2(R1) SET.BY #US.OFL

    679						;SET DEV OFFLINE

    680						POP @#4			;RESTORE INTRPT ADDRESS

    681						LET PS :B= #0		;ENABLE INTRPTS

    682						ERROR ER.CSR

    683						;INVALID CSR

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 8-6

ACTION ROUTINES



    684					CONT1:	LET U.ST2(R1) :B= U.ST2(R1) OFF.BY #US.OFL

    685						;SET DEVICE ON LINE

    686						POP @#4			;RESTORE INTRPT ADDRESS

    687						LET PS :B= #0		;DROP PRIORITY

    688						LET R1 := U.SCB(R1)	;SCB ADDRESS

    689						LET S.CSR(R1) := .PNUMB	;STORE CSR IN SCB

    690						LET $FLAG1 := $FLAG1 SET.BY #KY.NCP ; SET NON-COPY COMMAND

    691						RETURN

    692						;ON INVALID CSR, TRAP TO HERE		;SET CARRY BIT IN SAVED PS

    693					CONT2:	 LET 2(SP) := 2(SP) SET.BY #1

    694						RTI			;RETURN TO BCC CONT1

    695					STTM2:	LET R1 := DEVPT - #V.SIZ	;R1 POINTS AT DEV. NAME

    696						IF (R1) NE MMDEV THEN ERROR ER.TM2

    697							;TM02 VALID ONLY ON MM DEVICES

    698						LET R1  := $UCBAD		;UCB ADDRESS

    699						IF .PNUMB HI #7 THEN ERROR ER.TM2

    700						LET U.CNT+2(R1) := .PNUMB	;STORE TM02 IN UCB

    701						LET $FLAG1 := $FLAG1 SET.BY #KY.NCP ; SET NON-COPY COMMAND

    702						RETURN

    703						.ENDC

    704		000001 				.END

DSCPAR	X0033 - COMMAND PARSER 	MACRO M1110  21-AUG-78 20:41  PAGE 8-7

SYMBOL TABLE



A3    = 000000   	G.LULU= 000002   	L20     000726R  	S.FNAM= 000006   	$LUNBF= ****** GX

BAD     000174R     003	G.LUNA= 000000   	L21     000700R  	S.FNB = 000036   	$L$   = 000000

BAD1    000176R     003	G.LUNU= 000002   	L22     000722R  	S.FNBW= 000017   	$NUMBR= 000302

BAD2    000214R     003	IIDEV   000422R  	L23     000722R  	S.FNTY= 000004   	$OFLAG= ****** GX

B0      000560R  	IIII  = 177777   	L24     000740R  	S.FTYP= 000002   	$OVNUM= ****** GX

B1      001036R  	INIUNI  000500R  	L25     000760R  	S.NFEN= 000020   	$OVTAB= ****** GX

B2      001056R  	INLUN = ****** GX	L26     001024R  	TYPS0 = 000000   	$O$   = 000000

CML     000010RG    002	IODEV   000404R  	L27     001066R  	TYPS1 = 000006   	$R    = 177777

COLON   000262R     003	KY.APD= ****** GX	L3      000154R  	TYPS2 = 000000   	$RAD50= 000316

CONT3   000774R  	KY.CMP= ****** GX	L4      000174R  	UNIT    000250R     003	$STRNG= 000304

DENS    000146R     003	KY.DSK= ****** GX	L5      000200R  	VNUM    000004R     002	$SUBXP= 000310

DENS1   000164R     003	KY.IDK= ****** GX	L6      000206R  	V.FRBK= ****** GX	$SUPMC= 000043

DENS3   000166R     003	KY.ITP= ****** GX	L7      000232R  	V.LENG= ****** GX	$SV$  = 000000

DEVLST  000030R     003	KY.MAN= ****** GX	N.DID = 000024   	V.SIZ = ****** GX	$T    = 000030

DEVPT   000006R     002	KY.MRG= ****** GX	N.DVNM= 000032   	XITNRM  000402R  	$T1   = 000000

DEV1    000034R     003	KY.NAU= ****** GX	N.FID = 000000   	XPSTG   000070R     002	$T2   = 000027

DNSYN   000224R     003	KY.ODK= ****** GX	N.FNAM= 000006   	XSTSIZ= 000050   	$Y$   = 000000

DSCKTB  000000RG    004	KY.OTP= ****** GX	N.FTYP= 000014   	$ALPHA= 000322   	$Z$   = 000000

DSCSTB  000000RG    003	KY.RWD= ****** GX	N.FVER= 000016   	$ANY  = 000320   	$$S   = 000000

DV.F11= ****** GX	KY.TAP= ****** GX	N.NEXT= 000022   	$BLANK= 000306   	$$T   = 000026

DV.SQD= ****** GX	KY.VER= ****** GX	N.STAT= 000020   	$CW1  = ****** GX	$$TT  = 000014

ER.CDV= ****** GX	KY.16B= ****** GX	N.UNIT= 000034   	$CW2  = ****** GX	$$$   = 000000R     006

ER.DEV= ****** GX	KY.160= ****** GX	OPTS    000070R     003	$CW3  = ****** GX	$$$FLG= 177777

ER.DUD= ****** GX	LBLS0 = 000027   	OPTS1   000060R     003	$DIDDO= 000000   	$$$KEY= 000013

ER.F11= ****** GX	LBLS1 = 000002   	PROMPL= 000004   	$DIGIT= 000324   	$$$OST= 000014

ER.ILS= ****** GX	LBLS2 = 000023   	PROMPT  000000R     002	$DNUMB= 000314   	$$$STA= 000000

ER.LAB= ****** GX	LNDPB   000012R     002	RPCS  = 000000   	$DSCPR  000036RG 	$$$TMP= 000054R     005

ER.MXT= ****** GX	LOGNAM  000304R  	RPDS  = 177774   	$EF$  = 000000   	.GTCML= ****** GX

ER.SYN= ****** GX	L0      000120R  	RSCS2 = 000010   	$EOS  = 000312   	.PCHAR= ****** GX

ER.TMD= ****** GX	L1      000130R  	RSDT  = 000026   	$EXIT = 000000   	.PNUMB= ****** GX

EXPSTG  000140R     002	L10     000250R  	SETCON  000506R  	$E$   = 000001   	.PSTCN= ****** GX

E0      000612R  	L11     000270R  	SETDEV  000452R  	$FLAG1= ****** GX	.PSTPT= ****** GX

E1      001044R  	L12     000302R  	SETLAB  001010R  	$IFLAG= ****** GX	.TPARS= ****** GX

E2      001066R  	L13     000302R  	SETNMG  001100R  	$IVNUM= ****** GX	.$T   = 000006

FNB     000032R     002	L14     000464R  	SETUNT  000534R  	$IVTAB= ****** GX	...PC1= 000000

G.LUBA= 000004   	L15     000612R  	SETU0   000542R  	$I$   = 000001   	...PC2= 000014R

G.LUBL= 000006   	L16     000604R  	SET16B  001070R  	$L    = 000003   	...PC3= 000000

G.LUCW= 000004   	L17     000636R  	START   000000R     003	$LAMDA= 000300   	...TPC= 000036

G.LUFB= 000003   	L2      000150R



. ABS.	000000	   000

      	001116	   001

PARDAT	000144	   002

$STATE	000266	   003

$KTAB 	000030	   004

$KSTR 	000063	   005

$DPB$$	000006	   006

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  14480 WORDS  ( 57 PAGES)

DYNAMIC MEMORY:  15444 WORDS  ( 59 PAGES)

ELAPSED TIME:  00:03:58

EXE$:DSCPAR,LIS$:DSCPAR/-SP=SRC$:SMAC/PA:1,DSCPRE,DSCPAR

