GETNM - GET FILE NAME DESCRIPTO	MACRO M1110  22-AUG-78 01:27  PAGE 1





      1						.TITLE	GETNM - GET FILE NAME DESCRIPTOR

      2						.IDENT	/01/

      3

      4					;

      5					; SPECIAL GETNM FOR VAX

      6					;

      7					;+

      8					; GETNM - GET FILE NAME DESCRIPTOR

      9					;

     10					; THIS ROUTINE IS CALLED TO BUILD A FILENAME DATASET DESCRIPTOR FOR A FILE

     11					; SPECIFIER.

     12					;

     13					; INPUTS:

     14					;

     15					;	R1 = ADDRESS OF FIRST BYTE IN FILE SPECIFIER STRING.

     16					;	R3 = ADDRESS OF DATASET DESCRIPTOR.

     17					;	R4 = ADDRESS OF OUTPUT BUFFER FOR FILE NAME STRING.

     18					;

     19					; OUTPUTS:

     20					;

     21					;	C = 0 IF FILE SPECIFIER WAS PARSED SUCCESSFULLY.

     22					;	C = 1 IF A SYNTAX ERROR WAS ENCOUNTERED.

     23					;-

     24

     25	000000				GETNM::				;GET FILE NAME DESCRIPTOR

     26	000000	010446 				MOV	R4,-(SP)	;SAVE OUTPUT BUFFER POINTER

     27	000002	012700 	000041 			MOV	#33.,R0		;SET MAXIMUM LENGTH OF FILE SPECIFIER

     28	000006	005067 	000000G			CLR	VERFLG		;CLEAR VERSION FLAG

     29	000012	112102 			10$:	MOVB	(R1)+,R2	;GET NEXT CHARACTER FROM FILE SPECIFIER

     30	000014	122702 	000141 			CMPB	#141,R2		;POSSIBLY LOWER CASE?

     31	000020	101005 				BHI	20$		;IF HI NO

     32	000022	122702 	000172 			CMPB	#172,R2		;LOWER CASE LETTER?

     33	000026	103402 				BLO	20$		;IF LO NO

     34	000030	142702 	000040 			BICB	#40,R2		;CONVERT LOWER CASE TO UPPER CASE

     35	000034	110224 			20$:	MOVB	R2,(R4)+	;STORE CHARACTER IN OUTPUT BUFFER

     36	000036	122702 	000015 			CMPB	#15,R2		;CARRIAGE RETURN?

     37	000042	001412 				BEQ	40$		;IF EQ YES

     38	000044	122702 	000033 			CMPB	#33,R2		;ESCAPE?

     39	000050	001407 				BEQ	40$		;IF EQ YES

     40	000052	126702 	000000G			CMPB	CATEN,R2	;CONCATENATION CHARACTER?

     41	000056	001404 				BEQ	40$		;IF EQ YES

     42	000060	005300 				DEC	R0		;ANY MORE SPACE IN OUTPUT BUFFER?

     43	000062	003353 				BGT	10$		;IF GT YES

     44	000064	012604 			30$:	MOV	(SP)+,R4	;REMOVE BUFFER ADDRESS FROM STACK

     45	000066	000500 				BR	120$		;

     46	000070	105044 			40$:	CLRB	-(R4)		;CONVERT OUTPUT STRING TO ASCIZ

     47	000072	020416 				CMP	R4,(SP)		;NULL FILE SPECIFIER?

     48	000074	001773 				BEQ	30$		;IF EQ YES

     49	000076	122764 	000040 	177777 		CMPB	#' ,-1(R4)	;PREVIOUS CHARACTER A BLANK?

     50	000104	001771 				BEQ	40$		;IF EQ YES

     51	000106	012604 				MOV	(SP)+,R4	;RESTORE ADDRESS OF OUTPUT BUFFER

     52	000110	005013 				CLR	(R3)		;CLEAR LENGTH OF DEVICE NAME

     53	000112	010463 	000002 			MOV	R4,2(R3)	;SET ADDRESS OF DEVICE NAME

     54	000116	010400 				MOV	R4,R0		;COPY ADDRESS OF OUTPUT BUFFER

     55	000120	112001 			50$:	MOVB	(R0)+,R1	;GET NEXT CHARACTER

     56	000122	001410 				BEQ	60$		;IF EQ END OF STRING

     57	000124	122701 	000072 			CMPB	#':,R1		;DEVICE NAME TERMINATOR?

GETNM - GET FILE NAME DESCRIPTO	MACRO M1110  22-AUG-78 01:27  PAGE 1-1





     58	000130	001373 				BNE	50$		;IF NE NO

     59	000132	010013 				MOV	R0,(R3)		;CALCULATE LENGTH OF DEVICE NAME

     60	000134	160413 				SUB	R4,(R3)		;

     61	000136	005313 				DEC	(R3)		;REDUCE BY ONE TO ADJUST FOR COLON

     62	000140	001453 				BEQ	120$		;IF EQ NULL DEVICE NAME

     63	000142	010004 				MOV	R0,R4		;UPDATE ADDRESS IN OUTPUT BUFFER

     64	000144	005063 	000004 		60$:	CLR	4(R3)		;CLEAR LENGTH OF DIRECTORY STRING

     65	000150	010463 	000006 			MOV	R4,6(R3)	;SET ADDRESS OF DIRECTORY STRING

     66	000154	122714 	000133 			CMPB	#'[,(R4)	;DIRECTORY SPECIFIED?

     67	000160	001403 				BEQ	70$		;IF EQ YES

     68	000162	122714 	000074 			CMPB	#'<,(R4)	;DIRECTORY SPECIFIED?

     69	000166	001012 				BNE	80$		;IF NE NO

     70	000170	005263 	000004 		70$:	INC	4(R3)		;INCREMENT LENGTH OF DIRECTORY STRING

     71	000174	112401 				MOVB	(R4)+,R1	;GET NEXT CHARACTER

     72	000176	001434 				BEQ	120$		;IF EQ END OF STRING

     73	000200	122701 	000135 			CMPB	#'],R1		;END OF DIRECTORY STRING?

     74	000204	001403 				BEQ	80$		;IF EQ YES

     75	000206	122701 	000076 			CMPB	#'>,R1		;END OF DIRECTORY STRING?

     76	000212	001366 				BNE	70$		;IF NE NO

     77	000214	005000 			80$:	CLR	R0		;INDICATE NO TYPE FOUND

     78	000216	005063 	000010 			CLR	10(R3)		;CLEAR LENGTH OF FILE NAME STRING

     79	000222	010463 	000012 			MOV	R4,12(R3)	;SET ADDRESS OF FILE NAME STRING

     80	000226	112401 			90$:	MOVB	(R4)+,R1	;GET NEXT CHARACTER

     81	000230	001421 				BEQ	130$		;IF EQ END OF STRING

     82	000232	122701 	000056 			CMPB	#'.,R1		;FILE TYPE SPECIFIED?

     83	000236	001003 				BNE	100$		;IF NE NO

     84	000240	005700 				TST	R0		;TYPE ALREADY ENCOUNTERED?

     85	000242	001012 				BNE	120$		;IF NE YES

     86	000244	005200 				INC	R0		;SET TYPE ENCOUNTERED INDICATOR

     87	000246	122701 	000073 		100$:	CMPB	#';,R1		;FILE VERSION SPECIFIED?

     88	000252	001003 				BNE	110$		;IF NE NO

     89	000254	016367 	000010 	000000G		MOV	10(R3),VERFLG	;SET FILE VERSION CHARACTER COUNT

     90	000262	005263 	000010 		110$:	INC	10(R3)		;INCREMENT LENGTH OF FILE NAME STRING

     91	000266	000757 				BR	90$		;

     92	000270	000261 			120$:	SEC			;SET FAILURE INDICATION

     93	000272	000207 				RETURN			;

     94	000274	005700 			130$:	TST	R0		;FILE TYPE SPECIFIED?

     95	000276	001004 				BNE	140$		;IF NE NO

     96	000300	112744 	000056 			MOVB	#'.,-(R4)	;SET EXPLICIT FILE TYPE

     97	000304	005263 	000010 			INC	10(R3)		;INCREMENT FILE NAME STRING LENGTH

     98	000310	000207 			140$:	RETURN			;

     99

    100		000001 				.END

GETNM - GET FILE NAME DESCRIPTO	MACRO M1110  22-AUG-78 01:27  PAGE 1-2

SYMBOL TABLE



CATEN = ****** GX	GETNM   000000RG 	VERFLG= ****** GX



. ABS.	000000	   000

      	000312	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  129 WORDS  ( 1 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:03

OBJ$:GETNM,LIS$:GETNM/-SP=SRC$:GETNM

