CMLIO	MACRO M1110  21-AUG-78 23:21  PAGE 2





      1						.TITLE	CMLIO

      2						.IDENT	/00/

      3

      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 00

     20					;

     21					; C. MONIA 25-NOV-75

     22					;

     23					; PROCESS COMMAND LINE INPUT

     24					;

     25					; MACRO LIBRARY CALLS

     26					;

     27

     28						.MCALL	GCML$

     29

     30					;

     31					; LOCAL MACROS

     32					;

     33					; DEFINE ERROR MESSAGE CODES

     34					;

     35					; ERCOD	CODE,ERROR,SVRTY

     36					;

     37					; WHERE:

     38					;

     39					;	CODE=$GCML ERROR CODE

     40					;	ERROR,SEVRTY=ERROR MESSAGE ARGUMENTS (ERROR, SEVERITY) TO

     41					;		ACCOMPANY A CALL TO $ERMSG IF THE SPECIFIED ERROR

     42					;		OCCURS.

     43					;

     44

     45						.MACRO	ERCOD	CODE,ERROR,SVRTY

     46						.PSECT	ERCOD

     47						.WORD	177400!CODE

     48						.WORD	SVRTY*400!ERROR

     49						.WORD	0

     50					.=.-2

     51						.PSECT

     52						.ENDM

     53

     54					;

     55					; LOCAL DATA

     56					;

     57					; ERROR CODE TRANSLATION TABLE

CMLIO	MACRO M1110  21-AUG-78 23:21  PAGE 2-1





     58					;

     59

     60	000000					.PSECT	ERCOD,D

     61

     62	000000				ERRTB:	ERCOD	GE.BIF,E$R18,S$V2	; ILLEGAL INDIRECT FILE SPECIFICATION

     63	000000					ERCOD	GE.MDE,E$R19,S$V2	; MAX. INDIRECT DEPTH EXCEEDED

     64					;

     65					; PROMPT STRING BUFFER

     66					;

     67

     68	000000	   012 	   076 		PRMTBF:	.ASCII	<012>/>/	;

     69		000002 			PRMTLG=.-PRMTBF			; LENGTH OF PROMPT STRING

     70

     71						.EVEN

     72

     73					;+

     74					; **-$CMLIO-READ COMMAND LINE

     75					;

     76					; THIS SUBROUTINE IS CALLED TO READ A SINGLE COMMAND LINE AND RETURN

     77					; THE LENGTH AND ADDRESS OF THE LINE RECEIVED. THE COMMAND LINE IS

     78					; TERMINATED WITH A ZERO BYTE.

     79					;

     80					; INPUTS:

     81					;

     82					;	R0=ADDRESS OF '$GCML' BLOCK

     83					;	R1=ADDRESS OF PROMPT STRING (0=NONE)

     84					;	R2=LENGTH OF PROMPT

     85					;

     86					; OUTPUTS:

     87					;

     88					;	C/CLEAR - HAVE COMMAND LINE INPUT

     89					;

     90					;		R0=ADDRESS OF COMMAND LINE

     91					;		R1=LENGTH OF COMMAND LINE

     92					;

     93					;	C/SET - END OF FILE DETECTED

     94					;

     95					;-

     96

     97	000002				$CMLIO::			;

     98	000002	010046 				MOV	R0,-(SP)	; PUSH ADDRESS OF DESCRIPTOR

     99	000004	062716 	000146 			ADD	#G.CMLD,(SP)	; OFFSET TO LINE DESCRIPTOR

    100	000010				10$:				;

    101	000010	005701 				TST	R1		; PROMPT SPECIFIED?

    102	000012	001004 				BNE	15$		; IF NE NO

    103	000014	012701 	000000'			MOV	#PRMTBF,R1	; GET ADDRESS OF PROMPT STRING

    104	000020	012702 	000002 			MOV	#PRMTLG,R2	; LENGTH OF STRING

    105	000024				15$:				;

    106	000024					GCML$	R0,R1,R2	; GET COMMAND LINE

    107	000040	103025 				BCC	40$		; IF C/C HAVE COMMAND LINE

    108	000042	116002 	000140 			MOVB	G.ERR(R0),R2	; GET ERROR CODE

    109	000046	120227 	177766 			CMPB	R2,#GE.EOF	; END OF FILE?

    110	000052	000261 				SEC			; ASSUME YES

    111	000054	001430 				BEQ	50$		; IF EQ YES

    112	000056	012700 	177774'			MOV	#ERRTB-4,R0	; GET ADDRESS OF ERROR TABLE LESS OFFSET

    113	000062				20$:				;

    114	000062	022020 				CMP	(R0)+,(R0)+	; STEP TO NEXT ENTRY

CMLIO	MACRO M1110  21-AUG-78 23:21  PAGE 2-2





    115	000064	012701 	000000C			MOV	#S$V2*400!E$R17,R1 ; SET ERROR, SEVERITY

    116	000070	005710 				TST	(R0)		; END OF TABLE?

    117	000072	001404 				BEQ	30$		; IF EQ YES

    118	000074	021002 				CMP	(R0),R2		; TEST ERROR CODE

    119	000076	001371 				BNE	20$		; IF NE NOT SPECIFIED CODE

    120	000100	016001 	000002 			MOV	2(R0),R1	; GET ERROR, SEVERITY

    121	000104				30$:				;

    122	000104	012602 				MOV	(SP)+,R2	; GET COMMAND LINE DESCRIPTOR ADDRESS

    123	000106					ERROR$			; TRAP TO ERROR PROCESSOR, NO RETURN

    124	000114				40$:				;

    125	000114	005760 	000146 			TST	G.CMLD(R0)	; NULL LINE?

    126	000120	001733 				BEQ	10$		; IF EQ YES

    127	000122	011600 				MOV	(SP),R0		; GET ADDRESS OF DESCRIPTOR

    128	000124	012001 				MOV	(R0)+,R1	; GET BYTE COUNT

    129	000126	011000 				MOV	(R0),R0		; GET BUFFER ADDRESS

    130	000130	010002 				MOV	R0,R2		; COPY BUFFER ADDRESS

    131	000132	060102 				ADD	R1,R2		; OFFSET TO END OF BUFFER

    132	000134	105012 				CLRB	(R2)		; INSERT NULL AT END OF BUFFER

    133	000136				50$:				;

    134	000136	005226 				INC	(SP)+		; CLEAN STACK

    135	000140					RETURN			;

    136

    137		000001 				.END

CMLIO	MACRO M1110  21-AUG-78 23:21  PAGE 2-3

SYMBOL TABLE



CR    = 000015   	GE.CON= 000020   	G.CMLD= 000146   	PAR$$$= 000000   	S.FNBW= 000017

ERRTB   000000R     002	GE.EOF= 177766   	G.DPRM= 000160   	PRMTBF  000000R  	S.FNTY= 000004

E$R17 = ****** GX	GE.IND= 000002   	G.ERR = 000140   	PRMTLG= 000002   	S.FTYP= 000002

E$R18 = ****** GX	GE.IOR= 177777   	G.ISIZ= 000020   	R$$11M= 000000   	S.NFEN= 000020

E$R19 = ****** GX	GE.LC = 000010   	G.MODE= 000141   	SPA   = 000040   	VT    = 000013

FF    = 000014   	GE.MDE= 177774   	G.PSDS= 000142   	S$V2  = ****** GX	$CMD  = ****** GX

GE.BIF= 177775   	GE.OPR= 177776   	G.SIZE= 000224   	S.FDB = 000140   	$CMLIO  000002RG

GE.CLO= 000004   	GE.RBG= 177730   	HT    = 000011   	S.FNAM= 000006   	.GCML1= ****** G

GE.COM= 000001   	GE.SIZ= 000040   	LF    = 000012   	S.FNB = 000036   	...TPC= 000140



. ABS.	000000	   000

      	000142	   001

ERCOD 	000012	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  2278 WORDS  ( 9 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:12

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

