GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 1





      1						.TITLE	GETCML

      2						.IDENT	/01/

      3					;

      4					; COPYRIGHT (C) 1976

      5					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

      6					;

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

      8					; SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

      9					; SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

     10					; OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

     11					; AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

     12					; AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

     13					; OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

     14					;

     15					; THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

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

     17					; EQUIPMENT CORPORATION.

     18					;

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

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

     21					;

     22					; VERSION 01

     23					;

     24					; K. D. MORSE 1-AUG-76

     25					;

     26					; MACRO LIBRARY CALLS

     27					;

     28						.MCALL GCML$,GCMLB$,CSI$1,CSI$2,CSI$,CSI$SW,CSI$ND

     29						.MCALL OPEN$R,OPEN$W,FDAT$R,CLOSE$,DELET$,PRINT$,GET$,PUT$

     30						.MCALL WAIT$,READ$,WRITE$

     31					;

     32					; EQUATED SYMBOLS

     33					;

     34		000052 				AST==52			;ASCII VALUE OF ASTERISK

     35		000056 				PER==56			;ASCII VALUE OF PERIOD

     36		000072 				COL==72			;ASCII VALUE OF COLON

     37		000073 				SEMI==73			;ASCII VALUE OF SEMICOLON

     38					;

     39					; LOCAL DATA

     40					;

     41					;

     42					;

     43	000000	   123 	   131 		DEFDEV:: .ASCII	/SY/

     44					;

     45					; GCML CONTROL BLOCK

     46					;

     47						.EVEN

     48	000002				GCLBLK::	GCMLB$	2.,,,4.	;ALLOCATE AND INITIALIZE GCML CONTROL BLOCK

     49					;

     50					; CSI CONTROL BLOCK

     51					;

     52	000432					CSI$			;DEFINE CSI CONTROL BLOCK

     53						.EVEN			;

     54	000432				CSIBLK::	.BLKB	C.SIZE		;

     55					;

     56					; SWITCH TABLE

     57					;

GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 1-1





     58	000506	   000 			SWTBL:: .BYTE	0		;SWITCH TABLE, LIMITED TO FIVE SWITCHES

     59	000507	   000 			SWTVAL:: .BYTE	0		;++02 SWITCH VALUE TABLE, MAX OF 20 VALUES

     60						.EVEN

     61					;+

     62					;**-GETCML-GET LINE FROM COMMAND INPUT FILE

     63					;

     64					; THIS ROUTINE CALLS THE SYSTEM LIBRARY ROUTINE GCML$ TO READ THE NEXT RECORD

     65					; FROM THE COMMAND INPUT FILE.  IF COMMANDS ARE INITIATED FROM A TERMINAL,

     66					; THE USER IS PROMPTED WITH THE SUPPLIED STRING.  IF THE LINE CONTAINS

     67					; A LEADING ";", THEN IT IS TREATED AS A COMMENT AND ANOTHER LINE IS READ.

     68					;

     69					; INPUTS:

     70					;

     71					;	2(R5) IS THE ADDRESS FOR THE COMMAND LINE

     72					;	4(R5) IS THE ADDRESS FOR THE LENGTH OF THE RETURNED COMMAND LINE

     73					;	6(R5) IS THE ADDRESS FOR THE PROMPT

     74					;	10(R5) IS THE ADDRESS FOR THE LENGTH OF THE PROMPT

     75					;	12(R5) IS THE ADDRESS FOR THE SUCCESS/ERROR CODE

     76					;

     77					; OUTPUTS:

     78					;

     79					;	@2(R5) CONTAINS THE COMMAND LINE

     80					;	@12(R5) CONTAINS EITHER THE LENGTH OF THE COMMAND LINE OR

     81					;	       A CODE INDICATING THE FOLLOWING:

     82					;

     83					;			 >0 = SUCCESS

     84					;			 0 = EOF

     85					;			-1 = I/O ERROR

     86					;			-2 = UNABLE TO OPEN FILE

     87					;			-3 = INDIRECT FILE SYNTAX ERROR

     88					;			-4 = INDIRECT FILES TOO DEEPLY NESTED

     89					;-

     90	000510	012775 	000001 	000012 	GETCML:: MOV	#1,@12(R5)	;ASSUME SUCCESS

     91	000516					GCML$	#GCLBLK,6(R5),@10(R5)	;GET COMMAND LINE

     92	000542	103414 				BCS	20$		;ERROR IN COMMAND FETCH

     93	000544	016001 	000146 			MOV	G.CMLD(R0),R1	;GET LENGTH OF COMMAND LINE

     94	000550	003757 				BLE	GETCML		;LENGTH=0, PROMPT FOR NEW LINE

     95	000552	016002 	000150 			MOV	G.CMLD+2(R0),R2 ;GET ADDR OF COMMAND LINE

     96	000556	010175 	000004 			MOV	R1,@4(R5)	;SET UP LENGTH

     97	000562	016503 	000002 			MOV	2(R5),R3	;GET ADDR OF RETURN COMMAND LINE

     98	000566	112223 			10$:	MOVB	(R2)+,(R3)+	;MOVE IN COMMAND LINE

     99	000570	077102 				SOB	R1,10$		;LOOP UNTIL ALL OF LENGTH IS MOVED

    100	000572	000434 				BR	100$		;RETURN

    101					;

    102					; ERROR OR EOF

    103					;

    104					; SET LENGTH AS INDICATOR OF ERROR TYPE (OR EOF)

    105					;

    106	000574	116001 	000140 		20$:	MOVB	G.ERR(R0),R1	;MOVE IN ERROR CODE FROM GCML$

    107	000600	012775 	177777 	000012 		MOV	#-1,@12(R5)	;SET ERROR CODE

    108	000606	122701 	177777 			CMPB	#GE.IOR,R1	;IS IT AN I/O ERROR?

    109	000612	001424 				BEQ	100$		;YES, RETURN

    110	000614	005375 	000012 			DEC	@12(R5)		;NO, DECREMENT LENGTH WHICH IS ERR CODE

    111	000620	122701 	177776 			CMPB	#GE.OPR,R1	;IS IT UNABLE TO OPEN FILE ERROR?

    112	000624	001417 				BEQ	100$		;YES, RETURN

    113	000626	005375 	000012 			DEC	@12(R5)		;NO, DECREMENT ERROR CODE

    114	000632	122701 	177775 			CMPB	#GE.BIF,R1	;IS IT INDIRECT FILE SYNTAX ERROR?

GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 1-2





    115	000636	001412 				BEQ	100$		;YES, RETURN

    116	000640	005375 	000012 			DEC	@12(R5)		;NO, DECREMENT ERROR CODE

    117	000644	122701 	177774 			CMPB	#GE.MDE,R1	;IS IT TOO DEEPLY NESTED IN INDIRECTS?

    118	000650	001405 				BEQ	100$		;YES, RETURN

    119	000652	122701 	177766 			CMPB	#GE.EOF,R1	;IS IT EOF?

    120	000656	001002 				BNE	100$		;GOT UNKNOWN ERROR, RETURN

    121	000660	005075 	000012 			CLR	@12(R5)		;RETURN ZERO AS LENGTH TO INDICATE EOF

    122	000664	000207 			100$:	RETURN			;RETURN

GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 2





    124					;+

    125					;**-SYNTX-COMMAND LINE SYNTAX ANALYZER

    126					;

    127					; THIS ROUTINE ANALYZES THE SYNTAX OF A COMMAND LINE VIA THE SYSTEM LIBRARY

    128					; ROUTINE CSI$1.  IT COMPRESSES THE COMMAND LINE, REMOVING EXTRANEOUS BLANKS,

    129					; NULLS, TABS, AND RUBOUTS.  THE ROUTINE RETURNS THE COMPRESSED LINE,

    130					; TERMINATED BY A NULL, AND THE COMPRESSED LINE'S LENGTH.  IF AN ERROR IS

    131					; DETECTED IN THE LINE, THE PART OF THE LINE IN ERROR IS RETURNED INSTEAD

    132					; OF THE WHOLE LINE.  THE LENGTH OF THIS PART IS NEGATED AND RETURNED

    133					; INSTEAD OF THE TOTAL LENGTH.

    134					;

    135					; INPUTS:

    136					;

    137					;	2(R5) IS THE ADDRESS OF THE COMMAND LINE

    138					;	4(R5) IS THE ADDRESS OF THE LENGTH OF THE COMMAND LINE

    139					;	6(R5) IS THE ADDRESS OF THE SUCCESS/ERROR CODE

    140					;

    141					; OUTPUTS:

    142					;

    143					;	IF SYNTACTICALLY CORRECT:

    144					;

    145					;		@2(R5) CONTAINS THE COMPRESSED COMMAND LINE

    146					;		@4(R5) CONTAINS THE LENGTH OF THE COMPRESSED COMMAND LINE

    147					;

    148					;	IF SYNTACTICALLY INCORRECT:

    149					;

    150					;		@2(R5) CONTAINS THE PART OF THE LINE IN ERROR

    151					;		@4(R5) CONTAINS THE LENGTH OF THE PART IN ERROR

    152					;		@6(R5) CONTAINS THE SUCCESS/ERROR CODE

    153					;			>0 = SUCCESS

    154					;			<0 = SYNTAX ERROR

    155					;-

    156	000666	012775 	000001 	000006 	SYNTX:: MOV	#1,@6(R5)	;ASSUME SUCCESS

    157	000674	016504 	000002 			MOV	2(R5),R4	;GET ADDR OF COMMAND LINE

    158	000700					CSI$1	#CSIBLK,R4,@4(R5) ;ANALYZE SYNTAX

    159	000722	103013 				BCC	20$		;LINE SYNTAX OK, BRANCH

    160	000724	016002 	000016 			MOV	C.FILD(R0),R2	;GET LENGTH OF ERROR PART

    161	000730	016003 	000020 			MOV	C.FILD+2(R0),R3 ;GET ADDR OF ERROR PART

    162	000734	010275 	000004 			MOV	R2,@4(R5)	;STORE LENGTH OF ERROR PART

    163	000740	005475 	000006 			NEG	@6(R5)		;INDICATE ERROR

    164	000744	112324 			10$:	MOVB	(R3)+,(R4)+	;MOVE COMPRESSED LINE TO RETURNED LINE

    165	000746	077202 				SOB	R2,10$		;LOOP TO MOVE ALL OF COMPRESSED LINE

    166	000750	000407 				BR	30$		;GO CLEAR THE FOLLOWING BYTE

    167	000752	016075 	000002 	000004 	20$:	MOV	C.CMLD(R0),@4(R5) ;GET LENGTH OF COMPRESSED COMMAND LINE

    168	000760	016004 	000004 			MOV	C.CMLD+2(R0),R4 ;GET ADDRESS OF COMPRESSED COMMAND LINE

    169	000764	067504 	000004 			ADD	@4(R5),R4	;COMPUTE ADDRESS OF BYTE PAST LAST CHAR.

    170	000770	105024 			30$:	CLRB	(R4)+		;MOVE NULL TO END COMMAND LINE

    171	000772	000207 			100$:	RETURN			;RETURN

GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 3





    173					;+

    174					; **-SCANI/SCANO-SCAN FOR INPUT/OUTPUT FILE SPECIFICATION

    175					;

    176					; THIS ROUTINE SCANS A COMMAND LINE FOR THE NEXT INPUT OR OUTPUT FILE

    177					; SPECIFICATION VIA THE SYSTEM LIBRARY ROUTINE CSI$2.  THE ROUTINES BLDSWT

    178					; AND SYNTX MUST HAVE BEEN PREVIOUSLY CALLED TO SET UP THE SWITCH TABLE

    179					; AND TO DO THE SYNTAX ANALYSIS.  THE SCAN ROUTINE RETURNS THE REQUESTED

    180					; INPUT/OUTPUT SPECIFICATION PLUS ITS LENGTH AND AN INDICATOR IF A

    181					; SWITCH WAS SET.  A DEFAULT FILENAME AND TYPE OR JUST THE TYPE MAY BE

    182					; SPECIFIED WHERE THE TYPE CONSISTS OF A PERIOD AND THREE ASCII LETTERS.

    183					; AN ERROR IN THE LINE IS INDICATED BY RETURNING A NEGATIVE FILE

    184					; SPECIFICATION LENGTH.

    185					;

    186					; INPUTS:

    187					;

    188					;	2(R5) IS THE ADDRESS OF THE COMMAND LINE

    189					;	4(R5) IS THE ADDRESS OF THE LENGTH OF THE COMMAND LINE

    190					;	6(R5) IS THE ADDRESS FOR THE SWITCH INDICATOR

    191					;	10(R5) IS THE ADDRESS FOR THE FILE SPECIFICATION

    192					;	12(R5) IS THE ADDRESS FOR THE LENGTH OF THE FILE SPECIFICATION

    193					;	14(R5) IS THE ADDRESS OF A DEFAULT FILENAME/TYPE

    194					;	16(R5) IS THE ADDRESS OF THE LENGTH OF THE DEFAULT FILENAME/TYPE

    195					;	20(R5) IS THE ADDRESS OF THE SUCCESS/ERROR CODE

    196					;

    197					; OUTPUTS:

    198					;

    199					;	@2(R5) CONTAINS THE COMMAND LINE

    200					;	@4(R5) CONTAINS THE LENGTH OF THE COMMAND LINE

    201					;	@6(R5) CONTAINS THE SWITCH INDICATOR

    202					;		BITS 0-4 INDICATE SWITCHES THAT ARE SET

    203					;			(BIT 0=1 INDICATES SWITCH 1 WAS SET, ETC.)

    204					;	@10(R5) CONTAINS THE FILE SPECIFICATION

    205					;	@20(R5) INDICATES THE FOLLOWING:

    206					;		>0 = LENGTH OF VALID FILE SPECIFICATION

    207					;		-1 = SWITCH ERROR

    208					;		-2 = NO FILENAME OR DEFAULT FILENAME SPECIFIED

    209					;		-3 = NO FILE TYPE OR DEFAULT TYPE SPECIFIED

    210					;		-4 = ASTERISK INCLUDED AS PART OF FILENAME

    211					;

    212					;

    213					;

    214					;  MODIFICATIONS:

    215					;

    216					; NO		DATE		PROGRAMMER		PURPOSE

    217					; --		----		----------		-------

    218					;

    219					; 01		16-NOV-76	K.D. MORSE		INCLUDE ANY LENGTH

    220					;							DEFAULT FILE TYPE.

    221					; 02		16-NOV-76	K.D. MORSE		READ NEW SWITCH

    222					;							VALUE TABLE FORMAT.

    223					;

    224					;

    225					;-

    226	000774	112767 	000001 	177430 	SCANI::	MOVB	#CS.INP,CSIBLK+C.TYPR ;SET TYPE TO INPUT FILE

    227	001002	000403 				BR	CONT		;BRANCH TO AVOID RESETTING TYPE TO OUTPUT

    228	001004	112767 	000002 	177420 	SCANO::	MOVB	#CS.OUT,CSIBLK+C.TYPR ;SET TYPE TO OUTPUT FILE

    229	001012	012775 	000001 	000020 	CONT:	MOV	#1,@20(R5)	;SET SUCCESS CODE

GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 3-1





    230	001020	005075 	000012 			CLR	@12(R5)		;INITIALIZE FILE SPECIFICATION LENGTH

    231	001024	005075 	000006 			CLR	@6(R5)		;INITIALIZE SWITCH/ERROR CODE STORAGE

    232	001030	012700 	000507'			MOV	#SWTVAL,R0	;INITIALIZE SWITCH VALUES

    233	001034	105720 			5$:	TSTB	(R0)+		;IS THERE A VALUE TYPE SPECIFIED?

    234	001036	001410 				BEQ	7$		;NO, BRANCH

    235	001040	112002 				MOVB	(R0)+,R2	;YES, FIND NUMBER OF BYTES TO CLEAR

    236	001042	012003 				MOV	(R0)+,R3	;GET ADDRESS OF BYTES TO CLEAR

    237	001044	105023 			6$:	CLRB	(R3)+		;CLEAR A BYTE

    238	001046	077202 				SOB	R2,6$		;CONTINUE FOR THIS SWITCH VALUE

    239	001050	005710 				TST	(R0)		;++02 MORE THAN ONE VALUE FOR THIS SWITCH?

    240	001052	001370 				BNE	5$		;++02 YES, GO CLEAR IT

    241	001054	005720 				TST	(R0)+		;++02 NO, LOOK FOR NEXT SWITCH

    242	001056	000766 				BR	5$		;CHECK FOR ANOTHER SWITCH VALUE

    243	001060	012700 	000432'		7$:	MOV	#CSIBLK,R0	;GET ADDRESS OF CONTROL BLOCK

    244	001064	016560 	000002 	000004 		MOV	2(R5),C.CMLD+2(R0) ;GET ADDRESS OF COMMAND LINE

    245	001072	017560 	000004 	000002 		MOV	@4(R5),C.CMLD(R0) ;GET LENGTH OF COMMAND LINE

    246	001100					CSI$2	R0,,#SWTBL	;GET FILENAME

    247	001112	103560 				BCS	90$		;SWITCH ERROR

    248	001114	116002 	000001 			MOVB	C.STAT(R0),R2	;GET STATUS BYTE

    249					;

    250					; BUILD FILE SPECIFICATION TO BE RETURNED

    251					;

    252					; GET DEVICE

    253					;

    254	001120	016502 	000010 		10$:	MOV	10(R5),R2	;GET ADDRESS FOR FILE SPECIFICATION

    255	001124	016003 	000010 			MOV	C.DEVD+2(R0),R3	;GET DEVICE NAME ADDRESS

    256	001130	016004 	000006 			MOV	C.DEVD(R0),R4	;GET DEVICE NAME LENGTH

    257	001134	003004 				BGT	18$		;BRANCH IF ZERO LENGTH

    258	001136	012703 	000000'			MOV	#DEFDEV,R3	;GET DEFAULT DEVICE ADDRESS

    259	001142	012704 	000002 			MOV	#2,R4		;SET LENGTH OF DEFAULT DEVICE

    260	001146	060475 	000012 		18$:	ADD	R4,@12(R5)	;ADD DEVICE LENGTH TO FILE SPEC. LENGTH

    261	001152	112322 			15$:	MOVB	(R3)+,(R2)+	;MOVE DEVICE INTO FILE SPECIFICATION PARAMETER

    262	001154	077402 				SOB	R4,15$		;LOOP UNTIL ALL OF LENGTH IS MOVED

    263	001156	112722 	000072 			MOVB	#COL,(R2)+	;MOVE IN A COLON

    264	001162	005275 	000012 			INC	@12(R5)		;ADD ONE TO SPEC. LENGTH FOR COLON

    265					;

    266					; GET DIRECTORY

    267					;

    268	001166	016004 	000012 		20$:	MOV	C.DIRD(R0),R4	;GET LENGTH OF DIRECTORY

    269	001172	001406 				BEQ	30$		;ZERO LENGTH, NO DIRECTORY SPECIFIED

    270	001174	060475 	000012 			ADD	R4,@12(R5)	;ADD DIRECTORY LENGTH TO FILE SPEC. LENGTH

    271	001200	016003 	000014 			MOV	C.DIRD+2(R0),R3	;GET ADDRESS OF DIRECTORY

    272	001204	112322 			25$:	MOVB	(R3)+,(R2)+	;MOVE DIRECTORY TO FILE SPECIFICATION

    273	001206	077402 				SOB	R4,25$		;LOOP UNTIL ALL OF LENGTH IS MOVED

    274					;

    275					; GET FILENAME

    276					;

    277	001210	016004 	000016 		30$:	MOV	C.FILD(R0),R4	;GET LENGTH OF FILENAME

    278	001214	001470 				BEQ	75$		;ZERO LENGTH, NO FILENAME

    279	001216	060475 	000012 			ADD	R4,@12(R5)	;ADD FILENAME LENGTH TO FILE SPEC. LENGTH

    280	001222	016003 	000020 			MOV	C.FILD+2(R0),R3	;GET ADDRESS OF FILENAME

    281	001226	005001 				CLR	R1		;INITIALIZE INDICATOR TO NO FILE TYPE

    282					;

    283					; CHECK EACH CHARACTER FOR SEMICOLON OR PERIOD.

    284					; PERIOD SETS A FLAG THAT TYPE WAS SPECIFIED, I.E. R1=1.

    285					; SEMICOLON CAUSES A CHECK THAT TYPE WAS SPECIFIED.  IF IT WAS NOT,

    286					; THEN THE DEFAULT TYPE, IF SPECIFIED, IS INSERTED BEFORE THE VERSION.

GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 3-2





    287					;

    288	001230	121327 	000056 			CMPB	(R3),#PER	;IS THERE ONLY A FILE TYPE, NO NAME?

    289	001234	001460 				BEQ	75$		;YES, CHECK IF CAN USE A DEFAULT NAME

    290	001236	121327 	000073 			CMPB	(R3),#SEMI	;IS THERE ONLY A VERSION, NO NAME?

    291	001242	001455 				BEQ	75$		;YES, CHECK FOR DEFAULT TYPE

    292	001244	121327 	000056 		35$:	CMPB	(R3),#PER	;IS CHARACTER A PERIOD?

    293	001250	001002 				BNE	40$		;NO, DON'T CHANGE INDICATOR

    294	001252	012701 	000001 			MOV	#1,R1		;SET INDICATOR--TYPE WAS FOUND

    295	001256	121327 	000052 		40$:	CMPB	(R3),#AST	;LOOK FOR ASTERISK IN FILENAME

    296	001262	001511 				BEQ	94$		;FOUND ONE, ERROR

    297	001264	121327 	000073 			CMPB	(R3),#SEMI	;IS VERSION SPECIFIED?

    298	001270	001402 				BEQ	50$		;IF SO, BRANCH TO CHECK FOR NO TYPE

    299	001272	112322 			45$:	MOVB	(R3)+,(R2)+	;MOVE IN FILENAME VALUE

    300	001274	077415 				SOB	R4,35$		;LOOP UNTIL ALL OF LENGTH IS MOVED

    301					;

    302					; CHECK WHETHER OR NOT TO MOVE IN DEFAULT TYPE

    303					;

    304	001276	005701 			50$:	TST	R1		;WAS AN EXPLICIT TYPE SPECIFIED?

    305	001300	001021 				BNE	60$		;YES, BRANCH

    306	001302	010446 				MOV	R4,-(SP)	;++01 SAVE NUMBER OF CHARS LEFT TO MOVE

    307	001304	017504 	000016 			MOV	@16(R5),R4	;++01 GET DEFAULT LENGTH

    308	001310	001471 				BEQ	93$		;NO DEFAULT SPECIFIED, BRANCH

    309	001312	016501 	000014 			MOV	14(R5),R1	;++01 POINT TO DEFAULT FILENAME

    310	001316	122721 	000056 		51$:	CMPB	#PER,(R1)+	;++01 IS THIS THE TYPE?

    311	001322	001402 				BEQ	52$		;++01 YES, GO MOVE IT IN

    312	001324	077404 				SOB	R4,51$		;++01 KEEP LOOKING FOR TYPE

    313	001326	000462 				BR	93$		;++01 NO DEFAULT LENGTH, ERROR

    314	001330	005301 			52$:	DEC	R1		;++01 POINT TO PERIOD

    315	001332	060475 	000012 			ADD	R4,@12(R5)	;++01 INCREMENT LENGTH OF FILE SPECIFICATION

    316	001336	112122 			55$:	MOVB	(R1)+,(R2)+	;MOVE IN DEFAULT TYPE

    317	001340	077402 				SOB	R4,55$		;LOOP TO MOVE IN DEFAULT TYPE

    318	001342	012604 				MOV	(SP)+,R4	;RESET COUNT OF REMAINING FILENAME CHARS.

    319	001344	005704 			60$:	TST	R4		;IS THERE MORE FILENAME TO MOVE?

    320	001346	001351 				BNE	45$		;YES, BRANCH

    321					;

    322					; CHECK FOR A SWITCH

    323					;

    324	001350	005775 	000006 		73$:	TST	@6(R5)		;CHECK IF ERROR OCCURRED

    325	001354	001403 				BEQ	74$		;NO ERROR, BRANCH

    326	001356	017575 	000006 	000020 		MOV	@6(R5),@20(R5) 	;SET LENGTH TO ERROR SWITCH

    327	001364	105022 			74$:	CLRB	(R2)+		;INSERT NULL ON END OF FILE SPECIFICATION

    328	001366	016075 	000024 	000006 		MOV	C.MKW1(R0),@6(R5) ;SET SWITCH VALUE

    329	001374	000447 				BR	100$		;RETURN

    330					;

    331					; FILENAME NOT SPECIFIED.  INSERT DEFAULT FILENAME INTO SPECIFICATION.

    332					;

    333	001376	017501 	000016 		75$:	MOV	@16(R5),R1	;IS DEFAULT SPECIFIED?

    334	001402	001430 				BEQ	92$		;NO, ERROR

    335	001404	016503 	000014 			MOV	14(R5),R3	;GET DEFAULT FILENAME ADDRESS

    336	001410	122713 	000056 			CMPB	#PER,(R3)	;WAS ONLY TYPE WAS SPECIFIED?

    337	001414	001423 				BEQ	92$		;YES, CHECK FOR SPECIFIED TYPE

    338	001416	060175 	000012 			ADD	R1,@12(R5)	;NO, MOVE IN DEFAULT LENGTH

    339	001422	122713 	000056 		80$:	CMPB	#PER,(R3)	;FINISHED MOVING DEFAULT FILENAME?

    340	001426	001402 				BEQ	85$		;YES, BRANCH TO CHECK FOR TYPE

    341	001430	112322 				MOVB	(R3)+,(R2)+	;MOVE IN DEFAULT FILENAME

    342	001432	077105 				SOB	R1,80$		;LOOP TILL OF ALL NAME IS MOVED

    343	001434	160175 	000012 		85$:	SUB	R1,@12(R5)	;SUBTRACT OFF LENGTH OF DEFAULT TYPE

GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 3-3





    344	001440	016003 	000020 		86$:	MOV	C.FILD+2(R0),R3	;REPLACE ADDRESS OF FILENAME TYPE

    345	001444	005001 				CLR	R1		;SET INDICATOR THAT TYPE IS NOT SPECIFIED

    346	001446	005704 				TST	R4		;IS THERE MORE FILENAME TO MOVE?

    347	001450	003275 				BGT	35$		;YES, GO MOVE INTO RETURNED FILE SPECIFICATION

    348	001452	000711 				BR	50$		;NO, CHECK FOR DEFAULT TYPE

    349					;

    350					;

    351					;	ERROR CODES

    352					;

    353					;

    354	001454	012775 	177777 	000020 	90$:	MOV	#-1,@20(R5)	;SWITCH ERROR

    355	001462	000414 				BR	100$		;RETURN

    356	001464	012775 	177776 	000006 	92$:	MOV	#-2,@6(R5)	;NEITHER FILENAME NOR DEFAULT SPECIFIED

    357	001472	000762 				BR	86$		;CHECK FOR TYPE

    358	001474	012604 			93$:	MOV	(SP)+,R4	;++01 RESTOR NUMBER OF CHARS. LEFT TO MOVE

    359	001476	012775 	177775 	000006 		MOV	#-3,@6(R5)	;NEITHER FILE TYPE NOR DEFAULT SPECIFIED

    360	001504	000717 				BR	60$		;CHECK FOR SWITCHES

    361	001506	012775 	177774 	000020 	94$:	MOV	#-4,@20(R5)	;ASTERISK FOUND IN FILENAME

    362	001514	000207 			100$:	RETURN			;RETURN

    363		000001 				.END

GETCML	MACRO M1110  22-AUG-78 03:14  PAGE 3-4

SYMBOL TABLE



AST   = 000052 G 	FD.TTY= ****** GX	F.FVER= 000120   	GE.CLO= 000004   	N.STAT= 000020

COL   = 000072 G 	F.ACTL= 000076   	F.HIBK= 000004   	GE.COM= 000001   	N.UNIT= 000034

CONT    001012R  	F.ALOC= 000040   	F.LUN = 000042   	GE.CON= 000020   	PAR$$$= 000000

CSIBLK  000432RG 	F.BBFS= 000062   	F.MBCT= 000054   	GE.EOF= 177766   	PER   = 000056 G

CS.DIF= 000002   	F.BDB = 000070   	F.MBC1= 000055   	GE.IND= 000002   	SCANI   000774RG

CS.DVF= 000004   	F.BGBC= 000057   	F.MBFG= 000056   	GE.IOR= 177777   	SCANO   001004RG

CS.EQU= 000040   	F.BKDN= 000026   	F.NRBD= 000024   	GE.LC = 000010   	SEMI  = 000073 G

CS.INP= 000001   	F.BKDS= 000020   	F.NREC= 000030   	GE.MDE= 177774   	SWTBL   000506RG

CS.MOR= 000020   	F.BKEF= 000050   	F.OVBS= 000030   	GE.OPR= 177776   	SWTVAL  000507RG

CS.NMF= 000001   	F.BKP1= 000051   	F.RACC= 000016   	GE.RBG= 177730   	SYNTX   000666RG

CS.OUT= 000002   	F.BKST= 000024   	F.RATT= 000001   	GE.SIZ= 000040   	S.FATT= 000016

CS.WLD= 000010   	F.BKVB= 000064   	F.RCNM= 000034   	G.CMLD= 000146   	S.FDB = 000140

C.CMLD= 000002   	F.CHR = 000075   	F.RCTL= 000017   	G.DPRM= 000160   	S.FNAM= 000006

C.DEVD= 000006   	F.CNTG= 000034   	F.RSIZ= 000002   	G.ERR = 000140   	S.FNB = 000036

C.DIRD= 000012   	F.DFNB= 000046   	F.RTYP= 000000   	G.ISIZ= 000020   	S.FNBW= 000017

C.DSDS= 000006   	F.DSPT= 000044   	F.SEQN= 000100   	G.LPDL= 000060   	S.FNTY= 000004

C.FILD= 000016   	F.DVNM= 000134   	F.SPDV= 000072   	G.MODE= 000141   	S.FTYP= 000002

C.MKW1= 000024   	F.EFBK= 000010   	F.SPUN= 000074   	G.PSDS= 000142   	S.NFEN= 000020

C.MKW2= 000026   	F.EFN = 000050   	F.STBK= 000036   	G.SIZE= 000224   	$$$   = 000162R

C.SIZE= 000054   	F.EOBB= 000032   	F.UNIT= 000136   	N.DID = 000024   	.CSI1 = ****** G

C.STAT= 000001   	F.ERR = 000052   	F.URBD= 000020   	N.DVNM= 000032   	.CSI2 = ****** G

C.SWAD= 000022   	F.FACC= 000043   	F.VBN = 000064   	N.FID = 000000   	.GCML1= ****** G

C.TYPR= 000000   	F.FFBY= 000014   	F.VBSZ= 000060   	N.FNAM= 000006   	...PC1= 000002R

DEFDEV  000000RG 	F.FNAM= 000110   	GCLBLK  000002RG 	N.FTYP= 000014   	...PC2= 000204R

FD.CCL= ****** GX	F.FNB = 000102   	GETCML  000510RG 	N.FVER= 000016   	...PC3= 000002R

FD.REC= ****** GX	F.FTYP= 000116   	GE.BIF= 177775   	N.NEXT= 000022   	...TPC= 000140



. ABS.	000000	   000

      	001516	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  5807 WORDS  ( 23 PAGES)

DYNAMIC MEMORY:  6996 WORDS  ( 26 PAGES)

ELAPSED TIME:  00:00:26

OBJ$:GETGMCL,LIS$:GETGMCL/-SP=SRC$:GETGMCL.MAC

