.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 1





      1					;

      2					; VAX/VMS PREFIX FILE FOR THE GCML.MAC

      3					;

      4		000001 				R$$11M=1		;RSX11M

      5		000001 				IAS=1			;USE IAS PROMPT READ

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 2





    100					;

    200					; GCML MACRO DEFINITIONS

    300					;

    400					; COPYRIGHT (C) 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.  01754

    500					; COPYRIGHT (C) 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.  01754

    600					;

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

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

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

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

   1100					;

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

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

   1400					; EQUIPMENT CORPORATION.

   1500					;

   1600					; VERSION 010

   1700					;

   1800					; WRITTEN BY:

   1900					;	R.B. GROVE	25-APR-73, BASE LEVEL 6B VERSION

   2000					;

   2100					; MODIFIED BY:

   2200					;	C.A. D'ELIA	19-OCT-73 (FOR RSX-11D V003A)

   2300					;	C.A. D'ELIA	28-MAR-74 (FOR GCML VERSION 09)

   2400					;	C.A. D'ELIA	01-AUG-74

   2500					;	C.A. D'ELIA	20-JAN-75

   2600					;	I. SMITH	04-JAN-77	CONTINUATION LINES

   2700					;

   2800					;

   2900

   3000					;

   3100					; GCMLB$ - GENERATE A CONTROL BLOCK FOR GCML$

   3200					;

   3300						.MACRO	GCMLB$	MAXD,PRMPT,UBUF,LUN,PDL,SIZE=80.,?PDL1,?DFNB,?BUF

   3400

   3500						.MCALL	FDBDF$,FDAT$A,FDOP$A,NMBLK$,FDBF$A,CBYTE$

   3600

   3700						FDBDF$			;DEFINE FDB

   3800						FDAT$A	2

   3900						.IF NB	<LUN>

   4000						FDOP$A	LUN,,DFNB

   4100						.IFF

   4200						FDOP$A	1,,DFNB

   4300						.ENDC

   4400						FDBF$A	,,1		;FORCE SINGLE BUFFERING

   4500

   4600						CBYTE$	<FD.TTY!FD.REC!FD.CCL>,F.RCTL  ;FUDGE INITIAL ATTRIBUTES

   4700

   4800

   4900						.MCALL	GCMLD$

   5000						GCMLD$			;DEFINE GCML OFFSETS

   5100

   5200						.BYTE	0		; ERROR BYTE

   5300						.BYTE	GE.COM!GE.IND!GE.CLO!GE.SIZ!GE.CON  ;MODE BYTE

   5400						.BLKW	4		;PROMPT STR AND CMD DESCRIPTORS

   5500						.BYTE	-1,MAXD		;CURRENT AND MAXIMUM DEPTHS

   5600

   5700						.IF B	<PDL>

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 2-1





   5800						.WORD	PDL1		;USE GENERATED PUSH-DOWN LIST

   5900						.IFF

   6000						.WORD	PDL		;USER SUPPLIED PUSH-DOWN LIST

   6100						.ENDC

   6200

   6300						.IF NB <UBUF>

   6400						.WORD	UBUF

   6500						.IFF

   6600						.WORD	BUF

   6700						.ENDC

   6800

   6900					$$$=.

   7000						.ASCII	<15><12>

   7100						.IF NB	<PRMPT>

   7200						.ASCII	/PRMPT>/

   7300						.IFF

   7400						.ASCII	/   >/

   7500						.ENDC

   7600					.=$$$+6

   7700

   7800					DFNB:	NMBLK$	CMI,CMD

   7900

   8000						.WORD	SIZE

   8100

   8200					G.LPDL=<MAXD+1>*<6+<5*2>>	;LENGTH (IN BYTES) OF REQUIRED PDL

   8300

   8400						.IF B	<PDL>

   8500					PDL1:	.BLKB	G.LPDL		;GENERATE REQUIRED PUSH-DOWN STORAGE

   8600						.ENDC

   8700

   8800						.IF B	<UBUF>

   8900					BUF:	.BLKB	SIZE+2.

   9000						.ENDC

   9100

   9200						.ENDM	GCMLB$

   9300

   9400

   9500

   9600

   9700					;

   9800					; GCML$  - GET COMMAND LINE MACRO

   9900					;

  10000						.MACRO	GCML$	NAME,ADPR,LNPR

  10100						.MCALL	GCMLD$,LDR0$

  10200						GCMLD$	DEF$L

  10300						LDR0$	NAME

  10400						.IF NB	<LNPR>

  10500						MOV	LNPR,G.PSDS(R0)

  10600						.IIF B	<ADPR>, .ERROR ; PROMPT STRING MISSING

  10700						.IIF NB	<ADPR>,	MOV	ADPR,G.PSDS+2(R0)

  10800						.ENDC

  10900						.IIF B	<LNPR>,	CLR	G.PSDS(R0)

  11000						.GLOBL	.GCML1

  11100						JSR	PC,.GCML1

  11200						.ENDM	GCML$

  11300

  11400

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 2-2





  11500

  11600

  11700

  11800					;

  11900					; RCML$  - RESET COMMAND LINE SCAN TO TOP LEVEL

  12000					;

  12100						.MACRO	RCML$	NAME

  12200						.MCALL	LDR0$

  12300						LDR0$	NAME

  12400						.GLOBL	.GCML2

  12500						JSR	PC,.GCML2

  12600						.ENDM	RCML$

  12700

  12800

  12900

  13000

  13100

  13200					;

  13300					; CCML$  - CLOSE CURRENT LEVEL OF COMMAND LINE

  13400					;

  13500						.MACRO	CCML$	BLK

  13600						.MCALL	LDR0$

  13700						LDR0$	BLK

  13800						.GLOBL	.GCML3

  13900						JSR	PC,.GCML3

  14000						.ENDM	CCML$

  14100

  14200

  14300

  14400

  14500

  14600					;

  14700					; GCMLD$ - GET COMMAND LINE SYMBOL DEFINITIONS

  14800					;

  14900						.MACRO	GCMLD$	GBL

  15000

  15100						.IF NDF	S.FDB	;MUST FIRST DEFINE SIZE OF FDB

  15200						.MCALL	FDBSZ$

  15300						FDBSZ$

  15400						.ENDC

  15500

  15600						.MCALL	GCML$D	;NOW DEFINE GCML SYMBOLS

  15700						GCML$D	GBL

  15800

  15900						.MACRO	GCMLD$	X

  16000						.ENDM

  16100

  16200

  16300						.ENDM	GCMLD$

  16400

  16500

  16600

  16700

  16800					;

  16900					; GCML$D - DEFINE GCML SYMBOLS (CALLED BY GCMLD$)

  17000					;

  17100

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 2-3





  17200						.MACRO	GCML$D	GBL

  17300

  17400						.IF IDN	<GBL>,<DEF$G>

  17500						.GLOBL	G.ERR,G.MODE,G.PSDS,G.CMLD,G.RBUF,G.DPRM,G.SIZE

  17600						.GLOBL	GE.COM,GE.IND,GE.CLO,GE.LC,GE.CON,GE.SIZ

  17700						.GLOBL	GE.IOR,GE.OPR,GE.BIF,GE.MDE,GE.EOF,GE.RBG

  17800						.ENDC

  17900

  18000

  18100					G.ERR	= S.FDB		;ERROR RETURN CODE BYTE

  18200					G.MODE	= G.ERR+1	;STATUS AND MODE CONTROL BYTE

  18300					G.PSDS	= G.ERR+2	;PROMPT STRING DESCRIPTOR

  18400					G.CMLD	= G.ERR+6	;COMMAND LINE DESCRIPTOR

  18450					G.RBUF	= G.ERR+14.	;BUFFER ADDRESS

  18500					G.ISIZ	= 16.		;SIZE OF IMPURE AREA (PTRS,FLAGS,COUNTS,ETC)

  18600					G.DPRM	= G.ERR+G.ISIZ	;DEFAULT PROMPT STRING

  18700					G.SIZE	= G.DPRM+6+S.FNB	; BUFFER SIZE

  18800					;

  18900					; G.MODE BIT DEFINITIONS

  19000					;

  19100					GE.COM	= 1		;COMMENT RECOGNITION

  19200					GE.IND	= 2		;INDIRECT FILE RECOGNITION

  19300					GE.CLO	= 4		;CLOSE COMMAND FILE BEFORE RETURN

  19400					GE.LC	= 10		;PASS LOWER CASE CHARACTERS

  19500					GE.CON	= 20		; CONTINUATION LINES ALLOWED

  19600					GE.SIZ	= 40		; BUFFER SIZE

  19700					;

  19800					; G.ERR VALUES

  19900					;

  20000					GE.IOR	= -1		;I/O ERRER

  20100					GE.OPR	= -2		;UNABLE TO OPEN INDIRECT FILE

  20200					GE.BIF	= -3		;BAD INDIRECT FILE NAME

  20300					GE.MDE	= -4		;MAXIMUM INDIRECT FILE DEPTH EXCEEDED

  20400					GE.EOF	= -10.		;END OF FILE

  20500					GE.RBG	= -40.		; BUFFER SIZE ERROR  (OVERFLOW)

  20600					;

  20700					; MACRO REDEFINITION

  20800					;

  20900						.MACRO	GCML$D	X

  21000						.ENDM

  21100

  21200						.ENDM	GCML$D

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 3





      1

      2						.IF NDF	R$$11M

      3

      4

      5						.TITLE	.GCML  RSX-11D GET COMMAND LINE

      6						.IDENT	/21.01/

      7						.IFF

      8

      9						.TITLE	.GCML  RSX-11M GET COMMAND LINE

     10						.IDENT	/M21.01/

     11

     12						.ENDC

     13

     14

     15

     16					;

     17					; COPYRIGHT 1977, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754

     18					; COPYRIGHT 1976, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754

     19					; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754

     20					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754

     21					; COPYRIGHT 1973, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754

     22					;

     23					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

     24					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     25					;

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

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

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

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

     30					;

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

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

     33					; EQUIPMENT CORPORATION.

     34					;

     35					; VERSION 21.01

     36					;

     37					; WRITTEN BY:

     38					;	R. GROVE

     39					;	P. KNEUVEN

     40					;

     41					; MODIFIED BY:

     42					;	C.A. D'ELIA	26-NOV-73	001

     43					;	C.A. D'ELIA	12-JAN-74	002

     44					;	C.A. D'ELIA	12-MAR-74	003

     45					;	C.A. D'ELIA	19-MAR-74	004

     46					;	C.A. D'ELIA	31-MAR-74	005

     47					;	C.A. D'ELIA	05-APR-74	006

     48					;	C.A. D'ELIA	04-JUN-74	007

     49					;	C.A. D'ELIA	01-JUL-74	008

     50					;	C.A. D'ELIA	01-AUG-74	009

     51					;	C.A. D'ELIA	20-JAN-75	010

     52					;	C.A. D'ELIA	21-MAR-75	011

     53					;	C.A. D'ELIA	30-JUL-75	012

     54					;	C.A. D'ELIA	21-JAN-76	013

     55					;	A.C. GOLDSTEIN	12-APR-76	014

     56					;	JOHN HARPER	22-SEP-76	015	CONDITIONALISE TERMINATION ON '/'

     57					;	I.S. / J.H.	04-JAN-77	016	CONTINUATION LINES

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 3-1





     58					;	C.A. D'ELIA	18-JAN-77	017	FIX BUG IF INDIRECT FAILURE

     59					;						AT MCR LEVEL

     60					;	B.L. SCHREIBER	27-APR-77	018 (BLS002) FIX BUG IF INDIRECT

     61					;					FAILURE AT MCR LEVEL (AGAIN)

     62					;					RE-INSERT LOST EDIT 015 (THIS

     63					;					BRINGS IAS AND RSX VERSIONS

     64					;					BACK TOGETHER.

     65					;	B.L SCHREIBER	6-JUN-77	019 CONTINUATION LINES IN 1ST LEVEL

     66					;					INDIRECT FILE

     67					;	P.H. LIPMAN	6-JUN-77	020 ENTRY POINT TO AVOID RECEIVING

     68					;					EOF AFTER MCR LINE, 11M DETACH FOR

     69					;					INDIRECT FILE REQUIRED IF TTY ATTACHED

     70					;					ON ENTRY TO GCML.

     71					;

     72					;	R.B. GROVE	16-DEC-77	021 DO MULTIPLE GMCR$ AT TOP

     73					;					LEVEL FOR VAX/VMS AME

     74					;

     75					;

     76					; LOCAL OFFSET AND SYMBOL DEFINITIONS

     77

     78						.MCALL	CSI$		;++009

     79	000000					CSI$	DEF$L

     80						.MCALL	GCMLD$		;++009

     81	000000					GCMLD$	DEF$L

     82						.MCALL	NBOFF$		;++009

     83	000000					NBOFF$	DEF$L		;++009 DEFINE NAME BLOCK OFFSETS

     84

     85

     86						.MCALL	CALL,RETURN,DIR$,CSI$1,CSI$2,CLOSE$  ;++003

     87

     88

     89						.IF NDF	R$$11M		;++003

     90

     91						.MCALL	OPEN$R,GET$	;++003

     92

     93						.IFF			;++003

     94

     95						.MCALL	OFNB$R,GET$S,FINIT$,ENCP$S,DSCP$S  ;++010

     96

     97						.ENDC			;++003

     98

     99

    100					; INTERNAL GCML$ BLOCK OFFSET DEFINITIONS

    101		000152 			G.CDEP	=G.ERR+10.	;CURRENT PUSH DOWN DEPTH

    102		000153 			G.MDEP	=G.CDEP+1	;MAXIMUM PUSH DOWN DEPTH

    103		000154 			G.PPTR	=G.MDEP+1	;PUSH DOWN STORAGE POINTER

    104		000156 			G.RBUF	=G.PPTR+2	;RECORD BUFFER POINTER

    105		000160 			G.DPRM	=G.RBUF+2	;DEFAULT PROMPT STRING TEXT

    106		000166 			G.DFNB	=G.DPRM+6	;DEFAULT FILE NAME BLOCK

    107		000224 			G.SIZE	=G.DFNB+S.FNB	;+++016 BUFFER SIZE

    108		000020 			G.PDSL = <3*2>+<5*2>	;++001 PUSH DOWN FRAME SIZE (8 WORDS)

    109

    110					; G.MODE BIT DEFINITIONS

    111		000200 			GE.MCR	=200		;G.MODE BIT, SET IF TOP LEVEL IS MCR LINE

    112

    113					; ASCII CHARACTER DEFINITIONS

    114		000015 			CR	=15

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 3-2





    115		000011 			TAB	=11

    116		000040 			BLANK	=40

    117		000033 			ALTMOD	=33

    118

    119						.MACRO	.SAVR1

    120						JSR	R5,.SAVR1

    121						.ENDM	.SAVR1

    122

    123

    124						.IF DF	R$$11M

    125

    126						.MACRO	SOB	REG,ADDR

    127						DEC	REG

    128						BNE	ADDR

    129						.ENDM	SOB

    130

    131						.ENDC

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 4





    133					; GCML$ - ENTRY TO GET NEXT COMMAND LINE

    134

    135	000000				.GCML1::.SAVR1

    136	000004	010005 				MOV	R0,R5		;BLOCK POINTER ALWAYS IN R5

    137	000006	005065 	000146 		NXTLIN:	CLR	G.CMLD(R5)	;++016 CLEAR LENGTH OF LINE

    138	000012	016565 	000156 	000150 		MOV	G.RBUF(R5),G.CMLD+2(R5) ;++016 SET BUFFER BASE ADDRESS

    139	000020	105765 	000152 		LVLTST:	TSTB	G.CDEP(R5)	;++012 TEST CURRENT DEPTH

    140	000024	001416 				BEQ	LVL0		;++001 SPECIAL TEST IF AT LEVEL ZERO

    141	000026	003026 				BGT	PROMPT		;++001 IF .GT. ZERO, THEN PROMPT FOR CMD

    142	000030					CALL	GETMCR		;TRY TO GET AN MCR LINE

    143	000034	103403 				BCS	NOTMCR		;+++016 IF CS NOT MCR COMMAND

    144	000036				A:				; ++021 REF TAG

    145	000036	010165 	000150 			MOV	R1,G.CMLD+2(R5)	;+++016 ELSE SET UP START OF CMD

    146	000042	000553 				BR	CMLSCN		;+++016 AND GO PROCESS

    147	000044				NOTMCR:

    148

    149

    150						.IF NDF	R$$11M		;++002

    151

    152

    153						OPEN$R	R5		;TOP-LEVEL OPEN

    154

    155						.IFF	;R$$11M		;++002

    156

    157	000044	016502 	000000G			MOV	F.DSPT(R5),R2	;++002 GET DESCRIPTOR IN R2

    158	000050					CALL	GOPEN		;++002 OPEN THE FILE

    159

    160						.IFTF	;R$$11M		;++010

    161

    162	000054	103002 				BCC	LVL0		;++008 SKIP ON SUCCESS

    163	000056	000167 	000600 			JMP	OPRERR		;INITIAL COMMAND FILE OPEN FAILED		;BLS002

    164	000062	132765 	000200 	000141 	LVL0:	BITB	#GE.MCR,G.MODE(R5) ;++001 DID WE HAVE MCR INPUT?		;**-1

    165	000070	001405 				BEQ	PROMPT		;+++016 SKIP IF NOT

    166	000072					CALL	GETMCR		; ++021 TRY MCR AGAIN (VAX/VMS)

    167	000076	103357 				BCC	A		; ++021 SUCCESS GO BACK AND CONTINUE

    168	000100	000167 	000474 			JMP	TOPEOF		;+++016 ELSE GET OUT - LEVEL 0 IS THE END

    169

    170	000104	005765 	000000G		PROMPT:	TST	F.BDB(R5)	;++001 IS FILE ALREADY OPEN?

    171	000110	001002 				BNE	1$		;++001 YES, SKIP THE OPEN

    172	000112					CALL	POPOP1		;++001 NO, POP IT UP AND OPEN IT

    173	000116	122775 	000000G	000000G	1$:	CMPB	#IE.EOF,@F.BDB(R5)  ;++011 DELAYED FCS EOF PENDING?

    174	000124	001002 				BNE	10$		;+++016 NO

    175	000126	000167 	000410 			JMP	IOEOF		;+++016 YES

    176	000132				10$:				;+++016

    177						.IF	NDF,IAS		;+++016

    178						CLR	-(SP)		;++013 RESERVE WORD FOR ATTACH STATUS

    179						.ENDC	;IAS		;+++016

    180	000132	132765 	000000G	000000G		BITB	#FD.TTY,F.RCTL(R5) ;++011 NO, IS FILE A TTY?

    181	000140	001463 				BEQ	4$		;NO - DON'T PROMPT

    182

    183						.IF	NDF,IAS		;+++016

    184						MOV	#IO.ATT,R1	;++001 SPECIFY ATTACH

    185						CLR	R2		;++001 NO EXTRA QIO PARMS NEEDED

    186						CALL	.XQIO		;++001 USE FCS TO ATTACH THE TTY

    187						MOVB	F.ERR(R0),(SP)	;++013 SAVE ATTACH STATUS

    188						.ENDC	;IAS		;+++016

    189

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 4-1





    190	000142	016501 	000144 			MOV	G.PSDS+2(R5),R1	;USER PROMPT STRING ADDRESS

    191	000146	016502 	000142 			MOV	G.PSDS(R5),R2	;USER PROMPT STRING LENGTH

    192	000152	001005 				BNE	2$		;USE USER'S STRING

    193	000154	010501 				MOV	R5,R1		;USE DEFAULT PROMPT FROM BLOCK

    194	000156	062701 	000160 			ADD	#G.DPRM,R1	;

    195	000162	012702 	000006 			MOV	#6,R2		;EXACTLY 6 BYTE'S WORTH

    196	000166				2$:				;++001

    197						.IF	DF,IAS		;+++016 USE IO.RPR FOR IAS

    198	000166	010246 				MOV	R2,-(SP)	;+++016 MAKE PARAMS, STARTING WITH PROMPT SIZE

    199	000170	010146 				MOV	R1,-(SP)	;+++016 AND LENGTH

    200	000172	005046 				CLR	-(SP)		;+++016 NO TIMEOUT

    201	000174	012746 	000120 			MOV	#80.,-(SP)	;+++016 SET DEFAULT BUFFER SIZE

    202	000200	132765 	000040 	000141 		BITB	#GE.SIZ,G.MODE(R5)	;+++016 SIZE SPECIFIED?

    203	000206	001402 				BEQ	20$		;+++016 NO  -  LEAVE DEFAULT

    204	000210	016516 	000224 			MOV	G.SIZE(R5),(SP)	;+++016 YES  -  SET SIZE

    205	000214	166516 	000146 		20$:	SUB	G.CMLD(R5),(SP)	;+++016 LESS CHARS ALREADY READ

    206	000220	016546 	000156 			MOV	G.RBUF(R5),-(SP) ;+++016 NOW THE BUF ADR

    207	000224	010603 				MOV	SP,R3		;+++016 FIVE PARAMS

    208	000226	012702 	000005 			MOV	#5,R2		;+++016 ...

    209	000232	012701 	000000G			MOV	#IO.RPR,R1	;+++016 GET FUNCTION CODE

    210	000236					CALL	.XQIO		;+++016 DO THE REQUEST

    211	000242	012626 				MOV	(SP)+,(SP)+	;+++016 CLEAN FIVE WORDS FROM THE STACK

    212	000244	012626 				MOV	(SP)+,(SP)+	;+++016 ...

    213	000246	005226 				INC	(SP)+		;+++016 ... LEAVING CC-C

    214	000250	016501 	000156 			MOV	G.RBUF(R5),R1	;+++016 PICK UP BUF ADR AGAIN

    215	000254	116503 	000000G			MOVB	F.ERR(R5),R3	;+++016 GET ERROR CODE

    216	000260	103517 				BCS	IOERR0		;+++016 IF CS ERROR FROM HANDLER

    217	000262	016502 	000000G			MOV	F.BDB(R5),R2	;+++016 GET IOSB ADR

    218	000266	021227 	000000G			CMP	(R2),#IS.SUC	;+++016 LINE TOO LONG FOR BUFFER?

    219	000272	001003 				BNE	3$		;+++016 SKIP IF NOT

    220	000274	112703 	000000G			MOVB	#IE.RBG,R3	;+++016 ELSE CALL IT 'RECORD TOO BIG'

    221	000300	000507 				BR	IOERR0		;+++016 AND GO HANDLE ERROR

    222	000302	016202 	000002 		3$:	MOV	2(R2),R2	;+++016 GET LENGTH OF LINE

    223	000306	000431 				BR	CMLSCN		;+++016 ELSE GO SCAN THE LINE

    224

    225						.IFF	;IAS		;+++016

    226						CLR	-(SP)		;+++016 CLEAR CARRIAGE CONTROL

    227						MOV	R2,-(SP)	;+++016 PUSH PROMPT LENGTH

    228						MOV	R1,-(SP)	;+++016 AND ADDRESS

    229						MOV	SP,R3		;+++016 AND SET UP PARAM BLOCK ADR

    230						MOV	#3,R2		;++002 SET PARAMETER COUNT

    231						MOV	#IO.WVB,R1	;++002 SPECIFY WRITE VIRTUAL BLOCK

    232						CALL	.XQIO		;++002 SEND PROMPT STRING

    233						INC	(SP)+		;+++016 CLEAN STACK...

    234						MOV	(SP)+,(SP)+	;+++016 LEAVING CC-C

    235						BCS	6$		;DETACH AND I/O ERROR HANDLING

    236						.ENDC	;IAS		;+++016

    237	000310				4$:				;++002

    238	000310	012701 	000120 			MOV	#80.,R1		;+++016 SET DEFAULT BUFFER SIZE

    239	000314	132765 	000040 	000141 		BITB	#GE.SIZ,G.MODE(R5)	;+++016 SIZE SPECIFIED?

    240	000322	001402 				BEQ	40$		;+++016 NO

    241	000324	016501 	000224 			MOV	G.SIZE(R5),R1	;+++016 YES  -  SET IT

    242	000330	166501 	000146 		40$:	SUB	G.CMLD(R5),R1	;+++016  LESS CHARS ALREADY READ

    243

    244						.IFT	;R$$11M		;++010

    245

    246						GET$	R5,G.RBUF(R5),R1  ;++002/016 READ A COMMAND LINE

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 4-2





    247

    248						.IFF	;R$$11M		;++002

    249

    250	000334					GET$S	R5,G.RBUF(R5),R1  ;++002/016 READ A COMMAND LINE

    251

    252						.ENDC			;++011 (R$$11M)

    253

    254

    255	000354				6$:

    256						.IF	DF,IAS		;+++016

    257	000354	116503 	000000G			MOVB	F.ERR(R5),R3	;+++016 JUST PICK UP ERROR CODE

    258						.IFF	;IAS		;+++016

    259						MOV	F.ERR(R5),R3	;++013/016 SAVE FCS RETURN STATUS

    260						MOV	@F.BDB(R0),R4	;++011 AND THE FCS I/O STATUS WORD

    261						TSTB	(SP)+		;++013 ATTACHED? (O=> NOT TTY, -VE=> ATT. FAILED)

    262						BLE	8$		;++013 IF LE NOT ATTACHED

    263

    264						.IF	DF,R$$11M	;++020 FOR 11M

    265						CALL	TTDET1		;++020 USE THE COMMON DETACH ROUTINE

    266

    267						.IFF	;R$$11M		;++020 FOR 11D USE IN LINE DETACH

    268						MOV	#IO.DET,R1	;++001 SPECIFY DETACH

    269						CLR	R2		;++001 NO EXTRA QIO PARMS NEEDED

    270						CALL	.XQIO		;++001 USE FCS TO DETACH THE TTY

    271						.ENDC	;R$$11M		;++020

    272

    273					8$:	MOV	R4,@F.BDB(R0)	;++011 RESTORE FCS I/O STATUS WORD

    274						MOV	R3,F.ERR(R0)	;++013 RESTORE FCS STATUS FOR USER

    275						TSTB	R3		;++013 AND SEE IF IT WAS OK

    276						.ENDC	;IAS

    277

    278	000360	100457 				BMI	IOERR0		;++013 IF MI ERROR IN GET$

    279	000362	016501 	000002G			MOV	F.NRBD+2(R5),R1	;GET COMMAND LINE ADDRESS

    280	000366	016502 	000000G			MOV	F.NRBD(R5),R2	;GET COMMAND LINE LENGTH

    281

    282					; PROCESS COMMAND LINE OBTAINED

    283					;    R1 IS COMMAND LINE ADDRESS

    284					;    R2 IS COMMAND LINE LENGTH

    285	000372	060265 	000146 		CMLSCN:	ADD	R2,G.CMLD(R5)	;+++016 SET LENGTH

    286	000376	005702 				TST	R2		;+++016 NULL LINE?

    287	000400	001505 				BEQ	OKOUT		;RETURN NULL LINE TO USER

    288	000402	132765 	000010 	000141 		BITB	#GE.LC,G.MODE(R5)  ;++010 DOES CALLER WANT LOWER CASE?

    289	000410	001015 				BNE	30$		;++010 IF NE YES

    290	000412	010246 				MOV	R2,-(SP)	;++010 SAVE CHARACTER COUNT

    291	000414	060201 				ADD	R2,R1		;++010 POINT TO END OF COMMAND LINE

    292	000416	124127 	000141 		10$:	CMPB	-(R1),#141	;++010 LESS THAN LOWER CASE "A"?

    293	000422	002405 				BLT	20$		;++010 SKIP IF TRUE

    294	000424	121127 	000172 			CMPB	(R1),#172	;++010 GREATER THAN LOWER CASE "Z"?

    295	000430	003002 				BGT	20$		;++010 SKIP IF TRUE

    296	000432	142711 	000040 			BICB	#40,(R1)	;++010 CONVERT TO UPPER CASE

    297	000436				20$:	SOB	R2,10$		;++010 REPEAT FOR ENTIRE COMMAND LINE

    298	000442	012602 				MOV	(SP)+,R2	;++010 RESTORE CHARACTER COUNT

    299	000444	132765 	000200 	000141 	30$:	BITB	#GE.MCR,G.MODE(R5)	;+++016 MCR LINE?

    300	000452	001403 				BEQ	35$		;+++016 NO

    301	000454	105765 	000152 			TSTB	G.CDEP(R5)	;+++016 YES  -  AT MCR LEVEL?

    302	000460	001535 				BEQ	INDIR		;+++016	YES  -  NO CONTINUATION OR COMMENT

    303	000462	026565 	000156 	000150 	35$:	CMP	G.RBUF(R5),G.CMLD+2(R5) ;+++016 ON A CONTINUATION?

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 4-3





    304	000470	001402 				BEQ	40$		;+++016 IF EQ NOT ON CONTINUATION

    305	000472	000167 	000470 			JMP	CHKCON		;+++016 ELSE DON'T LOOK AT ';' OR '@'

    306	000476	122711 	000073 		40$:	CMPB	#';,(R1)	;++010 CHECK FOR ; IN COLUMN 1

    307	000502	001124 				BNE	INDIR		;NO - CHECK FOR INDIRECT FILE

    308	000504	132765 	000001 	000141 		BITB	#GE.COM,G.MODE(R5); COMMENTS PERMITTED ?

    309	000512	001440 				BEQ	OKOUT		;+++016 N0 - RETURN TO USER

    310	000514	000167 	177266 			JMP	NXTLIN		;+++016 YES - GET ANOTHER LINE

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 5





    312					; I/O ERROR AND END-OF-FILE PROCESSING

    313	000520	120327 	000000G		IOERR0:	CMPB	R3,#IE.RBG	;+++016 RECORD TOO BIG FOR BUFFER?

    314	000524	001003 				BNE	10$		;+++016 IF NE NOT TOO BIG

    315	000526	012746 	177730 			MOV	#GE.RBG,-(SP)	;+++016 ELSE ERROR CODE IS 'BUFFER SIZE'

    316	000532	000431 				BR	OUT		;+++016 AND GO AWAY

    317	000534	122703 	000000G		10$:	CMPB	#IE.EOF,R3	;++001 END OF FILE ERROR?

    318	000540	001045 				BNE	IOERR		;NO - I/O ERROR

    319	000542	116500 	000152 		IOEOF:	MOVB	G.CDEP(R5),R0	;++011 ARE WE AT TOP LEVEL ALREADY ?

    320	000546	001414 				BEQ	TOPEOF		;YES - RETURN EOF TO CALLER

    321	000550	005300 				DEC	R0		;IF NOT AT LEVEL 1

    322	000552	001004 				BNE	2$		;POP UP AND CARRY ON

    323	000554	132765 	000200 	000141 		BITB	#GE.MCR,G.MODE(R5);IF RETURNING TO LEVEL 0

    324	000562	001006 				BNE	TOPEOF		;++001 AND TOP WAS MCR, RETURN EOF TO CALLER

    325	000564				2$:

    326						.IF	DF,R$$11M	;++020 FOR 11M MUST DETACH

    327	000564					CALL	TTDET		;++020 IF LUN IS ASSIGNED TO TERMINAL

    328						.ENDC	;R$$11M		;++020 ELSE FOLLOWING OPEN WILL FAIL

    329

    330	000570					CALL	POPOPN		;POP UP A LEVEL

    331	000574	000167 	177304 			JMP	PROMPT		;+++016 TRY FOR ANOTHER COMMAND

    332

    333					; EXITS FROM .GCML1 AND .GCML2

    334

    335	000600				TOPEOF:	CLOSE$	R5		;CLOSE TOP LEVEL CMI

    336	000606				TOPOUT:

    337	000606	012746 	177766 			MOV	#GE.EOF,-(SP)	;++005 INDICATE END-OF-FILE			;**-2

    338	000612	000401 				BR	OUT		;++005

    339

    340	000614	005046 			OKOUT:	CLR	-(SP)		;++005 INDICATE GCML SUCCESS

    341

    342	000616	132765 	000004 	000141 	OUT:	BITB	#GE.CLO,G.MODE(R5) ;++005 CLOSE FILE AFTER THIS GET?

    343	000624	001406 				BEQ	1$		;++001 NO, SET RETURN INFORMATION

    344	000626	016546 	000000G			MOV	F.ERR(R5),-(SP) ;++013 SAVE FCS ERROR STATUS

    345	000632					CALL	CLOCRT		;++001 YES, CLOSE CURRENT LEVEL

    346	000636	012665 	000000G			MOV	(SP)+,F.ERR(R5) ;++013 RESTORE ERROR STATUS FOR USER TO LOOK AT

    347	000642	111665 	000140 		1$:	MOVB	(SP),G.ERR(R5)	;++005 PUT RETURN CODE IN G.ERR

    348	000646	006126 				ROL	(SP)+		;++005 SET C-BIT RETURN STATUS

    349	000650	010500 				MOV	R5,R0		;RESTORE R0

    350	000652					RETURN

    351

    352	000654	012746 	177777 		IOERR:	MOV	#GE.IOR,-(SP)	;++005 INDICATE I/O ERROR

    353	000660	000756 				BR	OUT		;++005

    354	000662	012746 	177776 		OPRERR:	MOV	#GE.OPR,-(SP)	;++005 INDICATE INDIRECT OPEN ERROR

    355	000666	000753 				BR	OUT		;++005

    356	000670	062706 	000054 		BIFERR:	ADD	#C.SIZE,SP	;POP LINGERING CSI BLOCK FROM STACK

    357	000674	012746 	177775 			MOV	#GE.BIF,-(SP)	;++005 INDICATE BAD INDIRECT FILE NAME

    358	000700	000746 				BR	OUT		;++005

    359	000702	012746 	177774 		MDEERR:	MOV	#GE.MDE,-(SP)	;++005 INDICATE MAX INDIRECT DEPTH EXCEEDED

    360	000706	000743 				BR	OUT

    361

    362					; RCML$ - ENTRY TO POP WORLD TO TOP LEVEL

    363

    364	000710				.GCML2::.SAVR1

    365	000714	010005 				MOV	R0,R5		;SET UP BLOCK POINTER

    366	000716	105765 	000152 			TSTB	G.CDEP(R5)	;AT TOP ALREADY ?

    367	000722	003734 				BLE	OKOUT		;++007 YES -- EXIT

    368	000724	105365 	000152 		10$:	DECB	G.CDEP(R5)	;++004 DECREMENT CURRENT DEPTH COUNT

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 5-1





    369	000730	001404 				BEQ	20$		;++004 SKIP BEFORE TOP LEVEL (0) PROCESSED

    370	000732	162765 	000020 	000154 		SUB	#G.PDSL,G.PPTR(R5)  ;++004 BACK UP THE PUSH-DOWN LIST PTR

    371	000740	000771 				BR	10$		;++004 ITERATE

    372	000742	105265 	000152 		20$:	INCB	G.CDEP(R5)	;++004 INDICATE LEVEL ONE

    373	000746					CALL	POPOPN		;POP THINGS UP TO LEVEL 0

    374	000752	000720 				BR	OKOUT		;RETURN BLISSFULLY

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 6





    376					; SET UP TO PROCESS AN INDIRECT FILE

    377					; LOOK FOR @ IN COLUMN 1

    378					;    R1 IS COMMAND LINE ADDRESS

    379					;    R2 IS COMMAND LINE LENGTH

    380					;

    381	000754	122711 	000100 		INDIR:	CMPB	#'@,(R1)	;CHECK FOR @

    382	000760	001102 				BNE	CHKCON		;+++016 NO - CHECK FOR CONCATENATION CHAR

    383	000762	132765 	000002 	000141 		BITB	#GE.IND,G.MODE(R5); INDIRECT PERMITTED ?

    384	000770	001711 				BEQ	OKOUT		;NO  - RETURN IT TO USER

    385					; PROCESS INDIRECT FILE

    386	000772	126565 	000152 	000153 		CMPB	G.CDEP(R5),G.MDEP(R5)	;CHECK DEPTH

    387	001000	002340 				BGE	MDEERR		;TOO DEEP

    388	001002	162706 	000054 			SUB	#C.SIZE,SP	;ALLOCATE A CSI BLOCK ON STACK

    389	001006	122142 				CMPB	(R1)+,-(R2)	;SKIP OVER "@" AND DECR CHAR COUNT		;BLS002

    390					; CALL CSI1 AND CSI2								;**-2

    391	001010					CSI$1	SP,R1,R2	;CHECK SYNTAX ON FILE SPEC

    392	001026	016065 	000002 	000146 		MOV	C.CMLD(R0),G.CMLD(R5)	;SET COMPRESSED LENGTH

    393	001034	005265 	000146 			INC	G.CMLD(R5)	;ADJUST LENGTH FOR @ IN COLUMN 1

    394	001040	103713 				BCS	BIFERR		;BAD SYNTAX

    395	001042	132760 	000040 	000001 		BITB	#CS.EQU,C.STAT(R0)  ;++009 WAS EQUAL SIGN (=) FOUND?

    396	001050	001307 				BNE	BIFERR		;++009 ANY INDICATION OF INPUT SPEC IS ERROR

    397	001052					CSI$2	R0,OUTPUT	;GET THE OUTPUT FILE

    398	001062	103702 				BCS	BIFERR		;

    399	001064	132760 	000030 	000001 		BITB	#CS.WLD!CS.MOR,C.STAT(R0); NO * WILD CARDS, AND ONLY ONE FILE

    400	001072	001276 				BNE	BIFERR;

    401	001074	132760 	000005 	000001 		BITB	#CS.DVF!CS.NMF,C.STAT(R0);

    402	001102	001672 				BEQ	BIFERR		;ERROR - NO DEVICE OR FILE NAME

    403					; SAVE FILE ID AND POINTERS

    404	001104					CALL	PSHCLS		;PUSH AND CLOSE FILE

    405

    406						.IF DF	R$$11M		;++020 FOR 11M MUST ISSUE DETACH

    407	001110					CALL	TTDET		;++020 IF LUN IS ASSIGNED TO TERMINAL

    408						.ENDC	;R$$11M		;++020 OTHERWISE THE FOLLOWING OPEN WILL FAIL

    409

    410	001114	010602 				MOV	SP,R2		;++002 POINT R2 TO THE CSI DATA ...

    411	001116	062702 	000006 			ADD	#C.DSDS,R2	;++002 ... SET DESCRIPTOR

    412	001122	012765 	054523 	000220 		MOV	#"SY,N.DVNM+G.DFNB(R5);DEFAULT DEVICE IS SY FOR LOWER OPEN'S

    413

    414

    415						.IF NDF	R$$11M		;++002

    416

    417

    418						OPEN$R	R5,,R2		;++002 OPEN THE FILE

    419

    420						.IFF			;++002

    421

    422	001130					CALL	GOPEN		;++002 OPEN THE FILE

    423

    424

    425						.ENDC			;++002

    426

    427

    428	001134	103411 				BCS	4$		;ERROR - CLEANUP AND REPORT ERROR

    429	001136	062706 	000054 			ADD	#C.SIZE,SP	;POP CSI BLOCK FROM STACK

    430	001142	005065 	000146 			CLR	G.CMLD(R5)	;+++016 CLEAR COMMAND LENGTH

    431	001146	016565 	000156 	000150 		MOV	G.RBUF(R5),G.CMLD+2(R5)	;+++016  AND RESET BUFFER ADDRESS

    432	001154	000167 	176724 			JMP	PROMPT		;ALL OK - GET A COMMAND LINE

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 6-1





    433	001160	062706 	000054 		4$:	ADD	#C.SIZE,SP	;POP CSI BLOCK FROM STACK

    434	001164	000636 			OPRBR:	BR	OPRERR		;REPORT ERROR ON @ FILE OPEN			;**-1

    435

    436					; CHKCON - LOOK FOR CONCATENATION CHAR ('-') AT END OF LINE

    437	001166	132765 	000020 	000141 	CHKCON:	BITB	#GE.CON,G.MODE(R5) ;+++016 CONTINUATION WANTED?

    438	001174	001425 				BEQ	10$		;+++016 IF EQ NO

    439	001176	105765 	000152 			TSTB	G.CDEP(R5)	;++019 ALWAYS ALLOWED FOR INDIRECT FILES

    440	001202	001004 				BNE	2$		;++019 BRANCH IF INDIRECT FILE

    441	001204	132765 	000200 	000141 		BITB	#GE.MCR,G.MODE(R5)	;+++016 MCR COMMAND LINE?

    442	001212	001016 				BNE	10$		;+++016 YES  -  CONTINUATION IGNORED

    443	001214	060201 			2$:	ADD	R2,R1		;++019, +++016 POINT PAST END OF LINE

    444	001216	124127 	000055 			CMPB	-(R1),#'-	;+++016 GOT A '-'?

    445	001222	001007 				BNE	5$		;++016 FINISHED IF NOT

    446	001224	005302 				DEC	R2		;+++016 REMOVE CHARACTER

    447	001226	005365 	000146 			DEC	G.CMLD(R5)	;+++016 AND ADJUST USER'S COUNT

    448	001232	060265 	000156 			ADD	R2,G.RBUF(R5)	;+++016 BUMP THE BUFFER POINTER

    449	001236	000167 	176556 			JMP	LVLTST		;+++016 AND GO AGAIN

    450	001242	016565 	000150 	000156 	5$:	MOV	G.CMLD+2(R5),G.RBUF(R5)	;+++016 RESTORE BUFFER POINTER

    451	001250	000167 	177340 		10$:	JMP	OKOUT		;+++016 BRANCH AID TO GET OUT

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 7





    453					;

    454					; POPOPN - SUBROUTINE TO CLOSE, POP UP, AND RE-OPEN

    455					;

    456	001254				POPOPN:	CLOSE$	R5		;CLOSE CURRENT FILE

    457	001262				POPOP1:				;++001

    458	001262	016504 	000154 			MOV	G.PPTR(R5),R4	;UPDATE PUSHDOWN POINTER

    459	001266	162765 	000020 	000154 		SUB	#G.PDSL,G.PPTR(R5) ;++001 RESET PUSHDOWN PTR IN GCML BLK

    460	001274	105365 	000152 			DECB	G.CDEP(R5)	;DECREASE PUSHDOWN LEVEL

    461	001300	001004 				BNE	1$		; IF POPPING TO LEVEL 0

    462	001302	132765 	000200 	000141 		BITB	#GE.MCR,G.MODE(R5) ;++001 AND TOP WAS AN MCR LINE,

    463	001310	001041 				BNE	10$		;++017 DON'T RE-OPEN LEVEL 0

    464	001312	010503 			1$:	MOV	R5,R3		;++001 POINT R3 JUST PAST THE FILE ID ...

    465	001314	062703 	000006G			ADD	#F.FNB+N.FID+6,R3  ;++001 ...IN THE FDB

    466	001320	014443 				MOV	-(R4),-(R3)	;++001 TRANSFER ...

    467	001322	014443 				MOV	-(R4),-(R3)	;++001 ... THE ...

    468	001324	014443 				MOV	-(R4),-(R3)	;++001 ... FILE ID, ...

    469	001326	014463 	000032 			MOV	-(R4),N.DVNM-N.FID(R3)  ;++001 ... THE DEVICE NAME, AND ...

    470	001332	114463 	000034 			MOVB	-(R4),N.UNIT-N.FID(R3)  ;++011 ... UNIT NUMBER INTO THE FDB

    471

    472

    473						.IF NDF	R$$11M		;++002

    474

    475

    476						OPEN$R	R5		;RE-OPEN THE LEVEL ABOVE

    477

    478						.IFF			;++002

    479

    480	001336					OFNB$R	R5		;++003 OPEN FILE BY FILENAME BLOCK

    481

    482

    483						.ENDC	;R$$11M		;++002

    484

    485

    486	001352	103415 				BCS	4$		;ERROR ON RE-OPEN, VERY BAD

    487					; RESTORE POINTERS INTO THE FILE

    488	001354	114446 				MOVB	-(R4),-(SP)	;++011 SAVE THE OLD FCS I/O STATUS BYTE

    489	001356	014403 				MOV	-(R4),R3	;BYTE-IN-BLOCK

    490	001360	014402 				MOV	-(R4),R2	;

    491	001362	014401 				MOV	-(R4),R1	;VIRTUAL BLOCK NUMBER

    492	001364					CALL	.POINT		;FDB IS IN R0, NOW .POINT

    493	001370	112675 	000000G			MOVB	(SP)+,@F.BDB(R5)  ;++011 RESTORE OLD FCS I/O STATUS

    494	001374	103011 				BCC	20$		;++017 IF CC JUST RETURN -- NO ERRORS

    495	001376	122765 	000000G	000000G		CMPB	#IE.EOF,F.ERR(R5);

    496	001404	001405 				BEQ	20$		;++017 ANYTHING EXCEPT EOF IS AN I/O ERROR

    497	001406	012716 	000662'		4$:	MOV	#OPRERR,(SP)	;++017 ELSE, RETURN VIA OPEN ERROR CODE

    498	001412	000402 				BR	20$		;++017

    499	001414	012716 	000606'		10$:	MOV	#TOPOUT,(SP)	;RETURN EOF IF POPPING TO MCR LEVEL 0		;BLS002

    500	001420				20$:	RETURN			;ALL IS NOW READY FOR NEXT GET$			;**-1

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 8





    502					;++001

    503					;

    504					; CLOSE CURRENT COMMAND LEVEL

    505					;

    506					;--001

    507	001422				.GCML3::.SAVR1			;++001 SAVE REGISTERS

    508	001426	010005 				MOV	R0,R5		;++001 SET FDB POINTER

    509	001430	005765 	000000G		CLOCRT:	TST	F.BDB(R5)	;++001 IS FILE OPEN?

    510	001434	001432 				BEQ	PSHRTN		;++001 NO, JUST RETURN

    511

    512					;

    513					; PSHCLS - SUBROUTINE TO PUSH DOWN AND CLOSE

    514					;

    515	001436	105265 	000152 		PSHCLS:	INCB	G.CDEP(R5)	;++001 INCREASE PUSHDOWN LEVEL

    516	001442	016504 	000154 			MOV	G.PPTR(R5),R4	;NEXT PUSHDOWN FRAME

    517	001446	010500 				MOV	R5,R0		;GET FDB FOR .MARK

    518	001450					CALL	.MARK		;MARK CURRENT PLACE IN FILE FOR .POINT

    519	001454	010124 				MOV	R1,(R4)+	;VIRTUAL BLOCK NUMBER

    520	001456	010224 				MOV	R2,(R4)+	;

    521	001460	010324 				MOV	R3,(R4)+	;BYTE-IN-BLOCK

    522	001462	062700 	000000G			ADD	#F.FNB+N.FID,R0	;++001 POINT R0 TO FILE ID IN FDB

    523	001466	117524 	000000G			MOVB	@F.BDB(R5),(R4)+  ;++011 SAVE FCS I/O STATUS BYTE

    524	001472	116024 	000034 			MOVB	N.UNIT-N.FID(R0),(R4)+  ;++011 SAVE THE UNIT NUMBER, ...

    525	001476	016024 	000032 			MOV	N.DVNM-N.FID(R0),(R4)+  ;++001 ...THE DEVICE NAME, AND ...

    526	001502	012024 				MOV	(R0)+,(R4)+	;++001 ... THE ...

    527	001504	012024 				MOV	(R0)+,(R4)+	;++001 ... FILE ID ...

    528	001506	012024 				MOV	(R0)+,(R4)+	;++001 ... FROM FDB IN THE PUSH DOWN LIST

    529	001510	010465 	000154 			MOV	R4,G.PPTR(R5)	;RESET PUSHDOWN FRAME

    530	001514					CLOSE$	R5		;++001 CLOSE CURRENT LEVEL

    531	001522				PSHRTN:				;++001

    532	001522					RETURN

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 9





    534						.IF DF	R$$11M		;++002

    535

    536					;++002

    537					;

    538					; *-GOPEN-* OPEN FILE BY PERFORMING A PARSE, AND AN OPEN BY

    539					; 	    FILE NAME BLOCK.

    540					;

    541					; INPUTS:

    542					;	R2=DATA SET DESCRIPTOR ADDRESS

    543					;	R5=FDB/GCMLB ADDRESS

    544					;

    545					; OUTPUTS:

    546					;	R0,R1, AND R3 ARE LOST

    547					;	C-BIT CLEAR INDICATES SUCCESS OF ALL THREE STEPS

    548					;	C-BIT SET INDICATES FAILURE

    549					;

    550					;--002

    551	001524	010500 			GOPEN:	MOV	R5,R0		;++002 PUT FDB ADDR IN R0

    552	001526	013701 	000000G			MOV	@#.FSRPT,R1	;++002 MUST DETERMINE IF A '.FINIT' ...

    553	001532	005761 	000000G			TST	A.DFUI(R1)	;++016 ...HAS BEEN PERFORMED

    554	001536	001002 				BNE	1$		;++002 IF SO, THEN SKIP

    555	001540					FINIT$			;++002 INITIALIZE

    556	001544	010001 			1$:	MOV	R0,R1		;++002 POINT R1 TO THE ...

    557	001546	062701 	000000G			ADD	#F.FNB,R1	;++002 ... FILE NAME BLOCK

    558	001552	016003 	000000G			MOV	F.DFNB(R0),R3	;++002 PNT R3 TO DEFAULT FILE NAME BLOCK

    559	001556					CALL	.PARSE		;++002 PARSE THE FILE NAME

    560	001562	103405 				BCS	10$		;++002 SKIP ON ERROR

    561	001564					OFNB$R			;++003 OPEN FILE FOR READ (VIA FNB)

    562	001576				10$:	RETURN			;++002

    563

    564

    565					;

    566					; DETACH THE LUN IF ASSIGNED TO TERMINAL

    567					; R0, R1, R2 ALTERED, OTHERS PRESERVED

    568					;

    569

    570						.ENABL	LSB

    571	001600	132765 	000000G	000000G	TTDET:	BITB	#FD.TTY,F.RCTL(R5) ;++020 CURRENTLY ASSIGNED TO TERMINAL?

    572	001606	001406 				BEQ	20$		;++020 BRANCH IF NOT

    573	001610	010500 				MOV	R5,R0		;++020 FDB ADDRESS WHERE FCS EXPECTS IT

    574	001612	012701 	000000G		TTDET1:	MOV	#IO.DET,R1	;++020 DETACH FUNCTION CODE

    575	001616	005002 				CLR	R2		;++020 NO ADDITIONAL PARAMETERS

    576	001620					CALL	.XQIO		;++020 DETACH IS REQUIRED SO THAT AN

    577	001624				20$:	RETURN			;++020 ASSIGN LUN WILL WORK IN THE NEXT FCS CALL

    578						.DSABL	LSB		;++020

    579

    580						.ENDC			;++002

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 10





    582					; GETMCR - SUBROUTINE CONDITIONALLY GETS AN MCR LINE

    583					;    RETURNS

    584					;    C=1 IF NO MCR LINE, C=0 OTHERWISE

    585					;    R1=STRING ADDRESS

    586					;    R2=STRING LENGTH

    587					;    REGISTERS CHANGED R0-R4

    588	001626	016501 	000156 		GETMCR:	MOV	G.RBUF(R5),R1	;GET RECORD BUFFER ADDRESS

    589	001632	105065 	000152 			CLRB	G.CDEP(R5)	;++001 SET CMD LEVEL TO ZERO

    590	001636	012711 				MOV	(PC)+,(R1)	;SET UP "GET MCR LINE" DPB

    591	001640	   177 	   051 			.BYTE	127.,41.

    592	001642					DIR$	R1		;TRY TO GET AN MCR LINE

    593	001646	103435 				BCS	10$		;TASK NOT INVOKED AS MCR FUNCTION

    594	001650	005721 				TST	(R1)+		;POINT TO MCR LINE IN BUFFER

    595	001652	013702 	000000G			MOV	@#$DSW,R2	;++006 GET MCR LINE BYTE COUNT

    596

    597	001656				2$:	CALL	NXTBYT		;SCAN TO A TAB OR BLANK

    598	001662	103427 				BCS	10$		;NO COMMAND LINE FOLLOWING MCR FUNCTION

    599						.IF	DF	R$$11M	;++015

    600	001664	120027 	000057 			CMPB	R0,#'/		;++013 ALSO TERMINATE SCAN AT SLASH

    601	001670	001417 				BEQ	6$		;++013 IF MATCH THEN WE'RE DONE

    602						.ENDC			;++015

    603	001672	120027 	000011 			CMPB	R0,#TAB

    604	001676	001403 				BEQ	4$

    605	001700	120027 	000040 			CMPB	R0,#BLANK

    606	001704	001364 				BNE	2$

    607	001706				4$:	CALL	NXTBYT		;SKIP TABS AND BLANKS

    608	001712	103413 				BCS	10$

    609	001714	120027 	000011 			CMPB	R0,#TAB

    610	001720	001772 				BEQ	4$

    611	001722	120027 	000040 			CMPB	R0,#BLANK

    612	001726	001767 				BEQ	4$

    613

    614	001730				6$:				;++013

    615	001730	124122 				CMPB	-(R1),(R2)+	;++001 DECR POINTER AND INCR COUNT

    616	001732	152765 	000200 	000141 		BISB	#GE.MCR,G.MODE(R5);SET TOP-LEVEL MCR FLAG

    617	001740	000241 				CLC			;AND INDICATE MCR LINE GOTTEN

    618	001742				10$:	RETURN

    619

    620					; NXTBYT - GET NEXT BYTE FROM MCR LINE

    621					;    INPUT - R1 IS STRING POINTER, R2 IS REMAINING BYTE COUNT

    622					;    OUTPUT- R1,R2 UPDATED, R0 IS THE BYTE

    623					;    SETS C=1 ON END OF LINE

    624	001744	162702 	000001 		NXTBYT:	SUB	#1,R2		;++001 DECR R2 AND SET CC-C WHEN REACH -1

    625	001750	112100 				MOVB	(R1)+,R0	;GET NEXT BYTE

    626	001752					RETURN

    627

    628					;

    629					; CALL THE FOLLOWING ROUTINE ONCE ONLY AFTER THE FIRST GCML$ CALL TO

    630					; CAUSE SUBSEQUENT GCML$ CALLS TO GET COMMANDS FROM THE TERMINAL AFTER GETTING

    631					; A COMMAND FROM THE MCR COMMAND LINE.  THIS PROVIDES THE MECHANISM WHERBY

    632					; A PROGRAM CAN RECEIVE ITS FIRST COMMAND FROM THE MCR COMMAND LINE AND

    633					; ITS SUBSEQUENT COMMANDS FROM THE TERMINAL.  IF AN INDIRECT FILE

    634					; WAS SPECIFIED IN THE MCR COMMAND LINE, THE PROGRAM WILL STILL GET AN EOF

    635					; WHEN THE INDIRECT FILE IS EXHAUSTED.

    636					;

    637					; INPUTS:

    638					;

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 10-1





    639					;	R0 = GCML CONTROL BLOCK ADDRESS

    640					;

    641					; OUTPUTS:

    642					;

    643					;	NONE, ALL REGISTERS PRESERVED

    644					;

    645	001754	105760 	000152 		.GCML4::TSTB	G.CDEP(R0)	;++020 IF AT LEVEL 0

    646	001760	001011 				BNE	10$		;++020 BRANCH IF NOT

    647	001762	132760 	000200 	000141 		BITB	#GE.MCR,G.MODE(R0) ;++020 AND LAST LINE WAS MCR LINE

    648	001770	001405 				BEQ	10$		;++020 BRANCH IF NOT

    649	001772	142760 	000200 	000141 		BICB	#GE.MCR,G.MODE(R0) ;++020 FORGET THAT MCR LINE WAS READ

    650	002000	105360 	000152 			DECB	G.CDEP(R0)	;++020 AND SET UP TO GET ANOTHER MCR LINE

    651									;++020 WHICH WILL FAIL AND START

    652									;++020 GETTING LINES FROM TERMINAL

    653	002004				10$:	RETURN			;++020

    654

    655

    656		000001 				.END

.GCML  RSX-11M GET COMMAND LINE	MACRO M1110  22-AUG-78 01:24  PAGE 10-2

SYMBOL TABLE



A       000036R  	C.TYPR= 000000   	G.CDEP= 000152   	NXTBYT  001744R  	S.FNTY= 000004

ALTMOD= 000033   	FD.TTY= ****** GX	G.CMLD= 000146   	NXTLIN  000006R  	S.FTYP= 000002

A.DFUI= ****** GX	FO.RD = ****** GX	G.DFNB= 000166   	N.DID = 000024   	S.NFEN= 000020

BIFERR  000670R  	F.BDB = ****** GX	G.DPRM= 000160   	N.DVNM= 000032   	TAB   = 000011

BLANK = 000040   	F.DFNB= ****** GX	G.ERR = 000140   	N.FID = 000000   	TOPEOF  000600R

CHKCON  001166R  	F.DSPT= ****** GX	G.ISIZ= 000020   	N.FNAM= 000006   	TOPOUT  000606R

CLOCRT  001430R  	F.ERR = ****** GX	G.MDEP= 000153   	N.FTYP= 000014   	TTDET   001600R

CMLSCN  000372R  	F.FACC= ****** GX	G.MODE= 000141   	N.FVER= 000016   	TTDET1  001612R

CR    = 000015   	F.FNB = ****** GX	G.PDSL= 000020   	N.NEXT= 000022   	$DSW  = ****** GX

CS.DIF= 000002   	F.NRBD= ****** GX	G.PPTR= 000154   	N.STAT= 000020   	.CLOSE= ****** G

CS.DVF= 000004   	F.RCTL= ****** GX	G.PSDS= 000142   	N.UNIT= 000034   	.CSI1 = ****** G

CS.EQU= 000040   	F.URBD= ****** GX	G.RBUF= 000156   	OKOUT   000614R  	.CSI2 = ****** G

CS.INP= 000001   	GETMCR  001626R  	G.SIZE= 000224   	OPRBR   001164R  	.FINIT= ****** G

CS.MOR= 000020   	GE.BIF= 177775   	IAS   = 000001   	OPRERR  000662R  	.FSRPT= ****** GX

CS.NMF= 000001   	GE.CLO= 000004   	IE.EOF= ****** GX	OUT     000616R  	.GCML1  000000RG

CS.OUT= 000002   	GE.COM= 000001   	IE.RBG= ****** GX	PAR$$$= 000005   	.GCML2  000710RG

CS.WLD= 000010   	GE.CON= 000020   	INDIR   000754R  	POPOPN  001254R  	.GCML3  001422RG

C.CMLD= 000002   	GE.EOF= 177766   	IOEOF   000542R  	POPOP1  001262R  	.GCML4  001754RG

C.DEVD= 000006   	GE.IND= 000002   	IOERR   000654R  	PROMPT  000104R  	.GETSQ= ****** G

C.DIRD= 000012   	GE.IOR= 177777   	IOERR0  000520R  	PSHCLS  001436R  	.MARK = ****** GX

C.DSDS= 000006   	GE.LC = 000010   	IO.DET= ****** GX	PSHRTN  001522R  	.OPFNB= ****** G

C.FILD= 000016   	GE.MCR= 000200   	IO.RPR= ****** GX	R$$11M= 000001   	.PARSE= ****** GX

C.MKW1= 000024   	GE.MDE= 177774   	IS.SUC= ****** GX	S.FDB = 000140   	.POINT= ****** GX

C.MKW2= 000026   	GE.OPR= 177776   	LVLTST  000020R  	S.FNAM= 000006   	.SAVR1= ****** GX

C.SIZE= 000054   	GE.RBG= 177730   	LVL0    000062R  	S.FNB = 000036   	.XQIO = ****** GX

C.STAT= 000001   	GE.SIZ= 000040   	MDEERR  000702R  	S.FNBW= 000017   	...TPC= 000036

C.SWAD= 000022   	GOPEN   001524R  	NOTMCR  000044R



. ABS.	000000	   000

      	002006	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  4592 WORDS  ( 18 PAGES)

DYNAMIC MEMORY:  5940 WORDS  ( 22 PAGES)

ELAPSED TIME:  00:00:33

OBJ$:GCML,LIS$:GCML/-SP=SRC$:AMEPAR,GCLMAC,GCML

