GTCML	MACRO M1110  22-AUG-78 01:42  PAGE 2





      1						.TITLE	GTCML

      2						.IDENT	/06/                                                            ;**NEW**

      3					                                                                                ;**-1

      4					;

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

      6					;

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

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

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

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

     11					;

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

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

     14					; EQUIPMENT CORPORATION.

     15					;

     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY

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

     18					;

     19					; VERSION 06

     20					;                                                                               ;**-1

     21					; D. N. CUTLER/C. MONIA 07-FEB-74

     22					;

     23					; MODIFICATIONS

     24					;

     25					; NO.		DATE		PROGRAMMER

     26					; ---		----		----------

     27					;

     28					; 039		22-MARR-75	C. MONIA

     29					;

     30					;

     31					; MACRO LIBRARY CALLS

     32					;

     33

     34						.MCALL	GCML$

     35

     36					;+

     37					; **-$GTCML-GET LINE FROM COMMAND INPUT FILE

     38					;

     39					; THIS ROUTINE CALLS THE SYSTEM LIBRARY ROUTINE .GCML TO READ THE NEXT

     40					; RECORD FROM THE COMMAND INPUT FILE. IF THE LINE CONTAINS A LEADING ";",

     41					; THEN IT IS TREATED AS A COMMENT LINE AND ANOTHER LINE IS READ. IF THE

     42					; FIRST TWO CHARACTERS OF THE LINE ARE "/BLANK", "/0", OR "//", THEN A

     43					; LOGICAL EOF IS RETURNED TO THE CALLER. FOR "//" AND A REAL EOF, EN$DR

     44					; IS SET IN $SWTCH THUS CAUSING AN EXIT AT THE END OF THE CURRENT BUILD.

     45					; IF NONE OF THESE CONDITIONS ARE MET, THEN THE LINE IS TRANSFERED TO

     46					; $LNBUF, $LNDES IS SET UP AS THE LINE DESCRIPTOR, AND A RETURN TO THE

     47					; CALLER IS EXECUTED.

     48					;

     49					; INPUTS:

     50					;

     51					;	NONE.

     52					;

     53					; OUTPUTS:

     54					;

     55					;	C=1 IF LOGICAL EOF.

     56					;	C=0 IF REQUEST SUCESSFUL WITH LINE IN $LNBUF AND $LNDES SET UP AS

     57					;		THE LINE DESCRIPTOR.

GTCML	MACRO M1110  22-AUG-78 01:42  PAGE 2-1





     58					;		R0=ADDRESS OF LINE DESCRIPTOR.

     59					;-

     60

     61	000000	016700 	000000G		$GTCML::MOV	$CMIPT,R0	;GET COMMAND BLOCK ADDRESS

     62	000004	005002 				CLR	R2		;ASSUME STANDARD PROMPTING

     63	000006	016701 	000000G			MOV	$CMFLG,R1	;GET ADDRESS OF PROMPT DESCRIPTOR

     64	000012	001402 				BEQ	10$		;IF EQ NONE

     65	000014	012102 				MOV	(R1)+,R2	;GET LENGTH OF PROMPT STRING

     66	000016	011101 				MOV	(R1),R1		;GET ADDRESS OF PROMPT STRING

     67	000020				10$:	GCML$	R0,R1,R2	;GET COMMAND LINE

     68	000034	103435 				BCS	GTCML1		;IF CS EOF OR ERROR

     69	000036	016001 	000146 			MOV	G.CMLD(R0),R1	;GET LENGTH OF LINE

     70	000042	001756 				BEQ	$GTCML		;IF NULL TRY AGAIN

     71	000044	010167 	000000G			MOV	R1,$LNDES	;SET LENGTH OF LINE

     72	000050	016002 	000150 			MOV	G.CMLD+2(R0),R2	; GET LINE BUFFER ADDRESS

     73	000054	010267 	000002G			MOV	R2,$LNDES+2	;SET ADDRESS OF BUFFER

     74	000060	060201 				ADD	R2,R1		; COMPUTE ADDRESS OF LAST BYTE PLUS 1           ;**NEW**

     75	000062	105011 				CLRB	(R1)		; SET ZERO SENTINEL BYTE                        ;**NEW**

     76	000064	005001 				CLR	R1		;++039 SET FOR MOVB WITH NO SIGN EXTEND

     77	000066	156201 	000001 			BISB	1(R2),R1	;++039 GET SECOND BYTE IN STRING

     78	000072	000301 				SWAB	R1		;++039 POSITION TO HIGH BYTE

     79	000074	151201 				BISB	(R2),R1		;++039 GET FIRST BYTE IN STRING

     80	000076	022701 				CMP	(PC)+,R1	;++039 "/BLANK"?                                      ;**-1

     81	000100	   057 	   040 			.BYTE	'/,' 		;

     82	000102	001455 				BEQ	GTCML3		;IF EQ YES

     83	000104	022701 				CMP	(PC)+,R1	;++039 "/0"?

     84	000106	   057 	   000 			.BYTE	'/,0		;

     85	000110	001452 				BEQ	GTCML3		;IF EQ YES

     86	000112	022701 				CMP	(PC)+,R1	;++039 "//"?

     87	000114	   057 	   057 			.BYTE	'/,'/		;

     88	000116	001444 				BEQ	GTCML2		;IF EQ YES

     89	000120	012700 	000000G			MOV	#$LNDES,R0	;GET ADDRESS OF LINE DESCRIPTOR

     90	000124	000241 				CLC			;CLEAR CARRY

     91	000126					RETURN			;

     92

     93					;

     94					; EOF OR ERROR

     95					;

     96

     97	000130	116002 	000140 		GTCML1:	MOVB	G.ERR(R0),R2	;PICK UP ERROR CODE

     98	000134	122702 	177766 			CMPB	#GE.EOF,R2	;EOF?

     99	000140	001433 				BEQ	GTCML2		;IF EQ YES

    100	000142	012701 				MOV	(PC)+,R1	;ASSUME I/O ERROR

    101	000144	   000G	   000G			.BYTE	E$R6,S$V0	;DIAGNOSTIC

    102	000146	122702 	177777 			CMPB	#GE.IOR,R2	;I/O ERROR

    103	000152	001421 				BEQ	10$		;IF EQ YES

    104	000154	012701 				MOV	(PC)+,R1	;ASSUME OPEN FAILURE

    105	000156	   000G	   000G			.BYTE	E$R7,S$V2	;FATAL-NO RETURN

    106	000160	122702 	177776 			CMPB	#GE.OPR,R2	;OPEN FAILURE?

    107	000164	001414 				BEQ	10$		;IF EQ YES

    108	000166	012701 				MOV	(PC)+,R1	;ASSUME BAD FILENAME

    109	000170	   000G	   000G			.BYTE	E$R8,S$V2	;FATAL-NO RETURN

    110	000172	122702 	177775 			CMPB	#GE.BIF,R2	;BAD FILENAME?

    111	000176	001407 				BEQ	10$		;IF EQ YES

    112	000200	012701 				MOV	(PC)+,R1	;ASSUME MAX DEPTH EXCEEDED

    113	000202	   000G	   000G			.BYTE	E$R9,S$V2	;FATAL-NO RETURN

    114	000204	122702 	177774 			CMPB	#GE.MDE,R2	;MAX DEPTH EXCEEDED?

GTCML	MACRO M1110  22-AUG-78 01:42  PAGE 2-2





    115	000210	001402 				BEQ	10$		;IF EQ YES

    116	000212	012701 				MOV	(PC)+,R1	;ILLEGAL ERROR CODE

    117	000214	   000G	   000G			.BYTE	E$R0,S$V2	;FATAL-NO RETURN

    118	000216	010002 			10$:	MOV	R0,R2		;COPY ADDRESS OF CONTROL BLOCK

    119	000220	062702 	000146 			ADD	#G.CMLD,R2	;POINT TO LINE DESCRIPTOR

    120	000224					CALL	$ERMSG		;OUTPUT ERROR MESSAGE

    121	000230	052767 	000000G	000000G	GTCML2:	BIS	#EN$DR,$SWTCH	;SET END OF RUN

    122	000236	000261 			GTCML3:	SEC			;SET CARRY

    123	000240					RETURN			;

    124

    125		000001 				.END

GTCML	MACRO M1110  22-AUG-78 01:42  PAGE 2-3

SYMBOL TABLE



CR    = 000015   	GE.CON= 000020   	GTCML3  000236R  	R$$11M= 000000   	VT    = 000013

EN$DR = ****** GX	GE.EOF= 177766   	G.CMLD= 000146   	SPA   = 000040   	$CMFLG= ****** GX

E$R0  = ****** GX	GE.IND= 000002   	G.DPRM= 000160   	S$V0  = ****** GX	$CMIPT= ****** GX

E$R6  = ****** GX	GE.IOR= 177777   	G.ERR = 000140   	S$V2  = ****** GX	$ERMSG= ****** GX

E$R7  = ****** GX	GE.LC = 000010   	G.ISIZ= 000020   	S.FDB = 000140   	$GTCML  000000RG

E$R8  = ****** GX	GE.MDE= 177774   	G.MODE= 000141   	S.FNAM= 000006   	$LNDES= ****** GX

E$R9  = ****** GX	GE.OPR= 177776   	G.PSDS= 000142   	S.FNB = 000036   	$SWTCH= ****** GX

FF    = 000014   	GE.RBG= 177730   	G.SIZE= 000224   	S.FNBW= 000017   	$$    = 000001

GE.BIF= 177775   	GE.SIZ= 000040   	HT    = 000011   	S.FNTY= 000004   	.GCML1= ****** G

GE.CLO= 000004   	GTCML1  000130R  	LF    = 000012   	S.FTYP= 000002   	...TPC= 000140

GE.COM= 000001   	GTCML2  000230R  	PAR$$$= 000000   	S.NFEN= 000020



. ABS.	000000	   000

      	000242	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  2176 WORDS  ( 9 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:16

OBJ$:GTCML,LIS$:GTCML/-SP=SRC$:MACFLM,GTCML

