PIPDSP M0222, PIP COMMAND RECEI	MACRO M1110  22-AUG-78 01:33

TABLE OF CONTENTS



     7-    1	**** PIPDSP VERSION M0222 ****

     8-   41	COMMAND RECEIVER AND DISPATCHER

PIPDSP M0222, PIP COMMAND RECEI	MACRO M1110  22-AUG-78 01:33  PAGE 7





      1						.TITLE	PIPDSP M0222, PIP COMMAND RECEIVER & DISPATCHER

						.SBTTL	**** PIPDSP VERSION M0222 ****

						.IDENT	/M0222/

      2					; ALTERED:

      3					; ANDREW C. GOLDSTEIN  2-AUG-78  10:51

      4					; BENN L. SCHREIBER  29-MAR-77

      5					;

      6					; B. SCHREIBER	27-AUG-77

      7					;

      8					;	BLS025 -- ADD EXIT WITH STATUS

      9					;

     10					; COPYRIGHT (C) 1977, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.

     11					;

     12					; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD MASS.

     13					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD MASS.

     14

     15					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE

     16					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION

     17					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT

     18					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.

     19

     20					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT

     21					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL

     22					; EQUIPMENT CORPORATION.

     23

     24					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY

     25					; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     26					;

     27					; PETER H. LIPMAN 30-JAN-74;

     28					;

     29					; MACROS

     30					;

     31					; INVOKE FCS MACROS

     32					;

     33	000000					FLDSOF			;DEFINE THE FILE DESCRIPTOR OFFSETS

     34						.MCALL	CSI$

     35	000000					CSI$

     36						.MCALL	GCMLD$

     37	000000					GCMLD$

     38						.MCALL	CALL,RETURN,FINIT$,GLUN$S,EXIT$S,CSI$1,CSI$2,SVTK$S

     39						.MCALL	GTSK$S,GPRT$S

PIPDSP M0222, PIP COMMAND RECEI	MACRO M1110  22-AUG-78 01:33  PAGE 8

COMMAND RECEIVER AND DISPATCHER



     41						.SBTTL	COMMAND RECEIVER AND DISPATCHER

     42	000000					PURE.I

     43					;

     44					; INITIAL STARTING POINT

     45

     46						.ENABL	LSB

     47

     48	000000	010667 	000000G		.INIT::	MOV	SP,SAVSP

     49	000004	112767 	000000C	000000C		MOVB	#FD.TTY!FD.REC!FD.CCL,GCMLCB+F.RCTL ;MAKE MCR LEVEL LIKE TTY

     50	000012	152767 	000004 	000141G		BISB	#GE.CLO,GCMLCB+G.MODE ;FORCE GCML TO CLOSE CMD FILE EACH TIME

     51	000020					FINIT$

     52	000024					GLUN$S	#CMOLUN,#CODEV	;GET DEVICE AND UNIT OF COMMAND OUTPUT LUN

     53	000042	105067 	000001G			CLRB	COUNIT+1	;ZERO FLAGS BYTE IN UNIT WORD

     54

     55						.IF	GT,R$$DYM

     56	000046					GPRT$S	,#LINBUF	;GET PARTITION PARAMETERS

     57	000064	013700 	000000G			MOV	@#$DSW,R0	;GET BASE ADDRESS OF THE TASK

     58	000070					GTSK$S	#LINBUF		;GET TASK PARAMETERS

     59	000102	066700 	000032G			ADD	LINBUF+G.TSTS,R0 ;TOP OF AVAILABLE SPACE

     60

     61						.IFF

     62						MOV	#DYB1,.TOPAD

     63						MOV	#DYB2,R0

     64						.ENDC

     65

     66	000106	166700 	000000G			SUB	.TOPAD,R0	;NO. OF BYTES AVAILABLE FOR DYNAMIC MEM

     67	000112	042700 	000003 			BIC	#3,R0		;MULTIPLE OF 4 BYTES IN FILE STORAGE REGION

     68	000116	010067 	000000G			MOV	R0,.DYSIZ	;NO. OF BYTES OF DYNAMIC MEMORY

     69	000122	012767 	000001 	000000G		MOV	#1,.MBFCT	;ASSUME SINGLE BUFFERING

     70	000130	020027 	000000C			CMP	R0,#<4*<1000+S.BFHD>+1000> ;ENOUGH FOR DOUBLE BUFFERING?

     71	000134	103402 				BLO	10$		;BRANCH IF NOT

     72	000136	005267 	000000G			INC	.MBFCT		;YES, DEFAULT TO DOUBLE BUFFERING

     73	000142	016767 	000000G	000000G	10$:	MOV	.TOPAD,.DYBUF	;FAKE AN ALLOCATED BUFFER

     74	000150	010067 	000000G			MOV	R0,.DYBYT	;SO THAT .DYREL WILL RETURN IT TO FSR

     75	000154	042700 	000777 			BIC	#777,R0

     76	000160	000300 				SWAB	R0

     77	000162	006200 				ASR	R0		;NO. OF BLOCKS AVAILABLE

     78	000164	010067 	000000G			MOV	R0,.DYBLK	;STORE THE BLOCK COUNT

     79	000170	001006 				BNE	.RSTAR

     80	000172					ERROUT	DY01		;NOT ENOUGH DYNAMIC MEMORY

	000172	104402 				TRAP	X

	000174	000000G				.WORD	DY01SZ

	000176	000000G				.WORD	DY01MG

     81	000200				EXIT:

     82						.IF	NDF,R$$VMS

     83						MOV	.EXSTS,R0	;GET EXIT STATUS

     84						BPL	101$		;IF PL GO EXIT

     85						MOV	#EX$SUC,R0	;ELSE NO ERRORS--EXIT W/SUCCESS

     86					101$:	CALL	$EXST		;TRY AN EXIT WITH STATUS

     87						.ENDC

     88	000200					EXIT$S			;TRY AN EXIT

     89					;

     90					; RESTART HERE FOR SUBSEQUENT COMMANDS

     91					;

     92	000206				.RSTAR::

     93	000206	016706 	000000G			MOV	SAVSP,SP

     94	000212					CALL	CLOSE		;CLOSE ANY FILES LEFT OPEN

PIPDSP M0222, PIP COMMAND RECEI	MACRO M1110  22-AUG-78 01:33  PAGE 8-1

COMMAND RECEIVER AND DISPATCHER



     95	000216					CALL	.DYREL		;RELEASE ANY BUFFER IN USE TO FSR

     96	000222					CALL	TDRDEL

     97	000226	005067 	000000G			CLR	CMDWRD		;INIT FLAGS WORD

     98	000232	005067 	000002G			CLR	CMDWRD+2

     99	000236	012767 	177777 	000000G		MOV	#-1,PROWRD	;NO PROTECTION VALUE SPECIFIED

    100	000244	005067 	000000G			CLR	SPLCNT		;INIT SPOOL COUNT TO DEFAULT

    101	000250					CALL	GETCML		;GET THE NEXT COMMAND LINE

    102	000254	103751 				BCS	EXIT

    103	000256					CSI$1	#CSIBLK,GCMLCB+G.CMLD+2,GCMLCB+G.CMLD ;CHECK CMD SYNTAX

    104	000302	016067 	000002 	000146G		MOV	C.CMLD(R0),GCMLCB+G.CMLD ;FIX STRING SIZE (COMPRESSED)

    105	000310	103557 				BCS	SERR2		;BRANCH IF SYNTAX ERROR

    106

    107					; LOOK AT ALL THE SPECIFIERS TO GET THE GLOBAL FLAG

    108	000312	012700 	000000G			MOV	#CSIBLK,R0

    109	000316				20$:	CSI$2	R0,OUTPUT,#CSISWT

    110	000334	103467 				BCS	40$

    111	000336	132760 	000020 	000001 		BITB	#CS.MOR,C.STAT(R0)

    112	000344	001364 				BNE	20$

    113	000346				30$:	CSI$2	R0,INPUT,#CSISWT

    114	000364	103533 				BCS	SERR3

    115	000366	132760 	000020 	000001 		BITB	#CS.MOR,C.STAT(R0)

    116	000374	001364 				BNE	30$

    117					;

    118					; NOW RESET CSI

    119	000376					CSI$1	R0,GCMLCB+G.CMLD+2,GCMLCB+G.CMLD

    120	000416	103514 				BCS	SERR2

    121	000420	012767 	000000G	000000G		MOV	#ILCLSW,CPYCTL	;INIT THE LOCAL FLAGS REGISTER

    122	000426	012767 	000000G	000000G		MOV	#ILCLSW,.LCLSW	;INITIAL VALUE FOR LOCAL SWITHCES

    123					;

    124					; INIT ALL THE LOCAL SWITCHES SINCE CSI$2 SCAN SET THEM TO

    125					; LAST VALUES ON LAST LOCAL SWITCH IN THE LIST

    126	000434					CALL	INIPRO		;INIT THE PROTECTION SUBSWITCHES

    127						.IF	NDF,R$$VMS

    128						CLR	PURGCT		; CLEAR SO WILL DEFAULT PROPERLY

    129						.ENDC

    130	000440	005067 	000000G			CLR	BLKCNT		;INIT BLOCK COUNT (OUTPUT FILE SIZE)

    131	000444	005067 	000000G			CLR	LPTLEN		; CLEAR SO WILL DEFAULT PROPERLY

    132					;

    133					; SET UP THE OUTPUT SPEC AND THE 1ST INPUT SPEC

    134	000450	012701 	000000G			MOV	#OFNPT,R1

    135	000454					CALL	OUTCSI		;GET THE FIRST OUTPUT SPEC

    136	000460	103475 				BCS	SERR3		;BRANCH IF ERROR

    137	000462	016767 	000000G	000000G		MOV	CPYCTL,.OULCL	;SAVE LOCAL SWITCHES FROM 1ST OUT SPEC

    138	000470	042767 	000000G	000000G		BIC	#FILCL,CPYCTL	;KNOCK DOWN SWITCHES THAT DON'T DEFAULT

    139	000476	016767 	000000G	000000G		MOV	BUFSIZ,OBFSIZ	;SET BUFFER SIZE FOR OUTPUT FILE

    140	000504	012701 	000000G			MOV	#IFNPT,R1

    141	000510					CALL	INCSI		;GET THE FIRST INPUT SPEC

    142	000514	103457 			40$:	BCS	SERR3

    143	000516	032767 	000000C	000000G		BIT	#SHTLST!EVRYBT!TOTLBT,CMDWRD ; CHECK FOR LISTING OPTIONS

    144	000524	001403 				BEQ	50$		; BRANCH IF NONE

    145	000526	042767 	000000G	000000G		BIC	#LSTBIT,CMDWRD	; OVERRIDE /LI

    146	000534	016702 	000000G		50$:	MOV	CMDWRD,R2

    147	000540	001022 				BNE	DISPAT

    148	000542	016702 	000002G			MOV	CMDWRD+2,R2	; NOTHING IN FIRST WORD, TRY THE SECOND

    149	000546	001027 				BNE	DISPT2

    150					;

    151					; ALLOW SUBSWITCHES TO SPECIFY COMMAND SWITCH IF NONE SPECIFIED

PIPDSP M0222, PIP COMMAND RECEI	MACRO M1110  22-AUG-78 01:33  PAGE 8-2

COMMAND RECEIVER AND DISPATCHER



    152	000550	016703 	000000G			MOV	CPYCTL,R3

    153	000554	032703 	000000G			BIT	#NTCNTG,R3	;/-CO SWITCH SPECIFIED?

    154	000560	001420 				BEQ	60$		;IF ZERO THEN YES, COPY COMMAND

    155	000562	032703 	000000C			BIT	#WOPROB!GRPROB!OWPROB!SYPROB,R3

    156	000566	001415 				BEQ	60$		;COPY IF NO OTHER IMPLIED COMMAND

    157	000570	012702 	000000G			MOV	#PROTBT,R2	;ASSUME /PROTECTION

    158	000574	042703 	000000C			BIC	#WOPROB!GRPROB!OWPROB!SYPROB!FIDBIT!NTCNTG,R3

    159	000600	001030 				BNE	SERR4		; CHECK FOR CONFLICTING SWITCHES

    160	000602	010267 	000000G			MOV	R2,CMDWRD

    161					;

    162					; DISPATCH TO THE REQUESTED FUNCTION

    163					;

    164	000606	005767 	000002G		DISPAT:	TST	CMDWRD+2	;CHECK FOR DUPLICATE COMMANDS

    165	000612	001023 				BNE	SERR4		; YES - GET OUT

    166	000614	012700 	000000G			MOV	#CMDTBL,R0	; POINT TO COMMAND TABLE #1

    167	000620	000404 				BR	70$

    168

    169	000622	012702 	000000G		60$:	MOV	#MERGBT,R2	;EXECUTE THE COPY COMMAND

    170	000626	012700 	000000G		DISPT2:	MOV	#CMDTB2,R0	; POINT TO COMMAND TABLE #2

    171

    172	000632	006002 			70$:	ROR	R2		; SCAN FOR A COMMAND BIT

    173	000634	103402 				BCS	80$		; BRANCH IF FOUND

    174	000636	005720 				TST	(R0)+		; OTHERWISE BUMP TO NEXT TABLE ENTRY

    175	000640	000774 				BR	70$		; AND TRY AGAIN

    176

    177					; BIT FOUND IN COMMAND WORD - NO MORE SHOULD BE PRESENT

    178	000642	005702 			80$:	TST	R2

    179	000644	001006 				BNE	SERR4

    180	000646	000130 				JMP	@(R0)+		;GO EXECUTE THE COMMAND

    181

    182						.DSABL	LSB

PIPDSP M0222, PIP COMMAND RECEI	MACRO M1110  22-AUG-78 01:33  PAGE 9

COMMAND RECEIVER AND DISPATCHER



    184					;

    185					; SYNTAX ERROR FROM CSI$1

    186					; FORM ONE STRING WITH SYNTAX ERROR MSG AND PIECE OF CMD LINE

    187	000650				SERR2:	CALL	.SYNER

    188					;

    189					; BAD SWITCH OR VALUE FROM CSI$2

    190	000654				SERR3:	ERROUX	CR02

	000654	104403 				TRAP	X

	000656	000000G				.WORD	CR02SZ

	000660	000000G				.WORD	CR02MG

    191					;

    192					;MULTIPLE COMMAND SWITCHES FOUND

    193	000662				SERR4:	ERROUX	CR03

	000662	104403 				TRAP	X

	000664	000000G				.WORD	CR03SZ

	000666	000000G				.WORD	CR03MG

    194					;

    195					; OUTPUT PIP VERSION IDENTIFIER

    196	000670				PIPID::	ERROUX	IDNT

	000670	104403 				TRAP	X

	000672	000000G				.WORD	IDNTSZ

	000674	000000G				.WORD	IDNTMG

    197					;

    198					;

    199		000001 				.END

PIPDSP M0222, PIP COMMAND RECEI	MACRO M1110  22-AUG-78 01:33  PAGE 9-1

SYMBOL TABLE



AB.CDT  000105   	C.CMLD= 000002   	GE.SIZ= 000040   	LINBUF= ****** GX	SPLCNT= ****** GX

AB.CHU  000064   	C.DEVD= 000006   	GRPROB= ****** GX	LPTLEN= ****** GX	SYPROB= ****** GX

AB.EXP  000122   	C.DIRD= 000012   	G.CMLD= 000146   	LSTBIT= ****** GX	S.APPD= 000010

AB.FNU  000000   	C.DSDS= 000006   	G.DPRM= 000160   	MERGBT= ****** GX	S.BFHD= ****** GX

AB.FP   000062   	C.FILD= 000016   	G.ERR = 000140   	NB.NXD= 020000   	S.FDB = 000140

AB.FSQ  000002   	C.MKW1= 000024   	G.ISIZ= 000020   	NB.WLV= 010000   	S.FIDS= 000014

AB.GC   000061   	C.MKW2= 000026   	G.LUCW= 000004   	NTCNTG= ****** GX	S.FNAM= 000006

AB.NAM  000006   	C.SIZE= 000054   	G.LUFB= 000003   	N.DEVD= 000000   	S.FNB = 000036

AB.PC   000060   	C.STAT= 000001   	G.LUNA= 000000   	N.DIRD= 000004   	S.FNBW= 000017

AB.RDT  000070   	C.SWAD= 000022   	G.LUNU= 000002   	N.FLID= 000016   	S.FNTY= 000004

AB.REV  000066   	C.TYPR= 000000   	G.MODE= 000141   	N.FNMD= 000010   	S.FTYP= 000002

AB.UAT  000020   	DISPAT  000606R     002	G.PRFW= 000004   	N.SPEC= 000014   	S.NFEN= 000020

BLKCNT= ****** GX	DISPT2  000626R     002	G.PRPB= 000000   	OBFSIZ= ****** GX	TDRDEL= ****** GX

BUFSIZ= ****** GX	DY01MG= ****** GX	G.PRPS= 000002   	OFNPT = ****** GX	TOTLBT= ****** GX

CLOSE = ****** GX	DY01SZ= ****** GX	G.PSDS= 000142   	OUTCSI= ****** GX	WOPROB= ****** GX

CMDTBL= ****** GX	EVRYBT= ****** GX	G.SIZE= 000224   	OWPROB= ****** GX	X     = 000003

CMDTB2= ****** GX	EXIT    000200R     002	G.TSDU= 000036   	O$$DS2= 000001   	$DSW  = ****** GX

CMDWRD= ****** GX	FD.CCL= ****** GX	G.TSFW= 000024   	PAR$$$= 000000   	$$$OST= 000044

CMOLUN= ****** GX	FD.REC= ****** GX	G.TSGC= 000017   	PIPID   000670RG    002	$$$0ST= 000000

CODEV = ****** GX	FD.TTY= ****** GX	G.TSMT= 000022   	PROTBT= ****** GX	.CSI1 = ****** G

COUNIT= ****** GX	FIDBIT= ****** GX	G.TSNL= 000020   	PROWRD= ****** GX	.CSI2 = ****** G

CPYCTL= ****** GX	FILCL = ****** GX	G.TSPC= 000016   	RX$IAS= 000043   	.DYBLK= ****** GX

CR02MG= ****** GX	F.RCTL= ****** GX	G.TSPN= 000004   	RX$11D= 000040   	.DYBUF= ****** GX

CR02SZ= ****** GX	GCMLCB= ****** GX	G.TSPR= 000014   	RX$11M= 000041   	.DYBYT= ****** GX

CR03MG= ****** GX	GETCML= ****** GX	G.TSRN= 000010   	RX$11S= 000042   	.DYREL= ****** GX

CR03SZ= ****** GX	GE.BIF= 177775   	G.TSSY= 000034   	R$$DPB= 000001   	.DYSIZ= ****** GX

CSIBLK= ****** GX	GE.CLO= 000004   	G.TSTN= 000000   	R$$DYM= 000001   	.FINIT= ****** G

CSISWT= ****** GX	GE.COM= 000001   	G.TSTS= 000032   	R$$EIS= 000000   	.INIT   000000RG    002

CS.DIF= 000002   	GE.CON= 000020   	G.TSVA= 000026   	R$$VMS= 000001   	.LCLSW= ****** GX

CS.DVF= 000004   	GE.EOF= 177766   	G.TSVL= 000030   	R$$11M= 000001   	.MBFCT= ****** GX

CS.EQU= 000040   	GE.IND= 000002   	IDNTMG= ****** GX	SAVSP = ****** GX	.OULCL= ****** GX

CS.INP= 000001   	GE.IOR= 177777   	IDNTSZ= ****** GX	SERR2   000650R     002	.RSTAR  000206RG    002

CS.MOR= 000020   	GE.LC = 000010   	IFNPT = ****** GX	SERR3   000654R     002	.SYNER= ****** GX

CS.NMF= 000001   	GE.MDE= 177774   	ILCLSW= ****** GX	SERR4   000662R     002	.TOPAD= ****** GX

CS.OUT= 000002   	GE.OPR= 177776   	INCSI = ****** GX	SHTLST= ****** GX	...TPC= 000140

CS.WLD= 000010   	GE.RBG= 177730   	INIPRO= ****** GX



. ABS.	000131	   000

      	000000	   001

PURE$I	000676	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  5687 WORDS  ( 23 PAGES)

DYNAMIC MEMORY:  6996 WORDS  ( 26 PAGES)

ELAPSED TIME:  00:00:27

OBJ$:PIPDSP,LIS$:PIPDSP/-SP=SRC$:PIPMAC,PIPDSP

