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





      1						.TITLE	SCNFL

      2						.IDENT	/01/

      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					; D.N. CUTLER 16-OCT-72

     22					;

     23					; MONITOR DEPENDENT COMMAND STRING ANALYSIS ROUTINES

     24					;

     25					; MACRO LIBRARY CALLS

     26					;

     27

     28						.MCALL	CSI$,CSI$1,CSI$2

     29

     30					;

     31					; EQUATED SYMBOLS

     32					;

     33

     34	000000					CSI$			;DEFINE CSI BLOCK OFFSET DEFINITIONS

     35

     36					;

     37					; MAXIMUM SUBSTRING LENGTHS

     38					;

     39

     40		000020 			F$DEVL==16.			;DEVICE FIELD

     41		000037 			F$DIRL==31.			;DIRECTORY FIELD

     42		000021 			F$FILL==17.			;FILE NAME FIELD

     43

     44		000054 			T$MSIZ==C.SIZE			;SIZE OF CSI BLOCK

     45

     46					;+

     47					; **-$SCANI/$SCANO-SCAN FOR INPUT/OUTPUT FILE SPECIFCICATION

     48					;

     49					; THIS ROUTINE IS CALLED TO SCAN A COMMAND STRING FOR THE NEXT INPUT

     50					; OR OUTPUT FILE. $SYNTX MUST HAVE BEEN PREVIOUSLY CALLED TO SET UP

     51					; THE COMMAND BUFFER AND TO DO THE SYNTAX ANALYSIS.

     52					;

     53					; INPUTS:

     54					;

     55					;	R0=ADDRESS OF RECORD BLOCK.

     56					;	R1=ADDRESS OF TEMP BUFFER AREA.

     57					;	R2=ADDRESS OF CSI SWITCH BLOCK

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





     58					;

     59					; OUTPUTS:

     60					;

     61					;	C=1 IF NO FILE SPECIFIED OR ILLEGAL SWITCH.

     62					;	C=0 IF REQUEST IS SUCESSFUL.

     63					;	IN EITHER CASE R0 IS RETURNED AS THE MORE FILES FLAG.

     64					;		IF R0 EQ 0, THEN MORE FILES ARE SPECIFIED.

     65					;		IF R0 EQ 1, THEN NO MORE FILES ARE SPECIFIED.

     66					;-

     67

     68	000000	112761 	000001 	000000 	$SCANI::MOVB	#CS.INP,C.TYPR(R1);SET FOR INPUT FILE

     69	000006	000403 				BR	SCANO		;

     70	000010	112761 	000002 	000000 	$SCANO::MOVB	#CS.OUT,C.TYPR(R1);SET FOR OUTPUT FILE

     71	000016				SCANO:	SAVRG			;SAVE NONVOLITILE REGISTERS

     72	000022	010005 				MOV	R0,R5		;SAVE RECORD BLOCK ADDRESS

     73	000024					CSI$2	R1,,R2		;GET FILE SPECIFICATION

     74	000036	010102 				MOV	R1,R2		;COPY CSI BLOCK ADDRESS

     75	000040	116204 	000001 			MOVB	C.STAT(R2),R4	;GET STATUS BYTE

     76	000044	103427 				BCS	10$		;IF CS ILLEGAL SWITCH

     77	000046	132704 	000005 			BITB	#CS.NMF!CS.DVF,R4;FILE OR DEVICE SPECIFIED?

     78	000052	001450 				BEQ	60$		;IF EQ NO

     79	000054	132704 	000010 			BITB	#CS.WLD,R4	;WILD CARD SPECIFIED?

     80	000060	001024 				BNE	20$		;IF NE YES

     81	000062	022762 	000020 	000006 		CMP	#F$DEVL,C.DEVD(R2);LEGAL DEVICE NAME LENGTH?

     82	000070	103432 				BLO	40$		;IF LO NO

     83	000072	022762 	000037 	000012 		CMP	#F$DIRL,C.DIRD(R2);LEGAL DIRECTORY NAME LENGTH?

     84	000100	103421 				BLO	35$		;IF LO NO

     85	000102	022762 	000021 	000016 		CMP	#F$FILL,C.FILD(R2);LEGAL FILENAAME LENGTH?

     86	000110	103410 				BLO	20$		;IF LO NO

     87	000112	062702 	000006 			ADD	#C.DSDS,R2	;POINT TO CSI DATA SET DESCRIPTOR

     88	000116	010265 	000000G			MOV	R2,F.DSPT(R5)	;SET ADDRESS OF DESCRIPTOR

     89	000122	000425 				BR	70$		;

     90

     91					;

     92					; ILLEGAL SWITCH SPECIFICATION

     93					;

     94

     95	000124	012701 			10$:	MOV	(PC)+,R1	;GET ERROR,SEVERITY

     96	000126	   000G	   000G			.BYTE	E$R20,S$V2	;FATAL-NO RETURN

     97	000130	000402 				BR	30$		;

     98

     99					;

    100					; ILLEGAL FILE SPECIFICATION

    101					;

    102

    103	000132	012701 			20$:	MOV	(PC)+,R1	;GET ERROR,SEVERITY

    104	000134	   000G	   000G			.BYTE	E$R21,S$V2	;FATAL-NO RETURN

    105	000136	062702 	000016 		30$:	ADD	#C.FILD,R2	;POINT TO FILENAME DESCRIPTOR

    106	000142	000411 				BR	50$		;

    107

    108					;

    109					; ILLEGAL DIRECTORY NAME

    110					;

    111

    112	000144	012701 			35$:	MOV	(PC)+,R1	;GET ERROR,SEVERITY

    113	000146	   000G	   000G			.BYTE	E$R24,S$V2	;FATAL-NO RETURN

    114	000150	062702 	000012 			ADD	#C.DIRD,R2	;POINT TO DIRECTORY NAME

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





    115	000154	000404 				BR	50$		;

    116

    117					;

    118					; ILLEGAL DEVICE SPECIFICATION

    119					;

    120

    121	000156	012701 			40$:	MOV	(PC)+,R1	;GET ERROR,SEVERITY

    122	000160	   000G	   000G			.BYTE	E$R22,S$V2	;FATAL-NO RETURN

    123	000162	062702 	000006 			ADD	#C.DEVD,R2	;POINT TO DEVICE NAME DESCRIPTOR

    124	000166				50$:	ERROR$			;OUTPUT ERROR MESSAGE

    125	000174	000261 			60$:	SEC			;SET CARRY

    126	000176	006046 			70$:	ROR	-(SP)		;SAVE CARRY BIT

    127	000200	005000 				CLR	R0		;ASSUME MORE FILES ARE SPECIFIED

    128	000202	132704 	000020 			BITB	#CS.MOR,R4	;MORE FILES?

    129	000206	001001 				BNE	80$		;IF NE YES

    130	000210	005200 				INC	R0		;SET NO FILES

    131	000212	006126 			80$:	ROL	(SP)+		;RESTORE CARRY

    132	000214					RETURN			;

    133

    134					;+

    135					; **-$SYNTX-COMMAND STRING SYNTAX ANALYSIS

    136					;

    137					; THIS ROUTINE IS CALLED TO ANALYZE A COMMAND STRING FOR CORRECT SYN-

    138					; TAX AND TO SET UP THE COMMAND BUFFER FOR THE ABOVE SCAN ROUTINES.

    139					;

    140					; INPUTS:

    141					;

    142					;	R0=ADDRESS OF BYTE COUNT,REC ADDR DOUBLEWORD.

    143					;	R1=ADDRESS OF TEMP BUFFER AREA

    144					;

    145					; OUTPUTS:

    146					;

    147					;	C=1 IF SYNTAX ERROR.

    148					;	C=0 IF NO SYNTAX ERROR.

    149					;-

    150

    151	000216	012061 	000002 		$SYNTX::MOV	(R0)+,C.CMLD(R1);SET LENGTH OF LINE

    152	000222	011061 	000004 			MOV	(R0),C.CMLD+2(R1);SET ADDRESS OF LINE

    153	000226					CSI$1	R1		;ANALYZE SYNTAX

    154	000234	103011 				BCC	10$		;IF CS RETURN

    155	000236	010102 				MOV	R1,R2		;COPY ADDRESS OF CSI BLOCK

    156	000240	062702 	000002 			ADD	#C.CMLD,R2	;POINT TO LINE SEGMENT DESCRIPTOR

    157	000244	012701 				MOV	(PC)+,R1	;SYNTAX ERROR

    158	000246	   000G	   000G			.BYTE	E$R23,S$V1	;DIAGNOSTIC

    159	000250					ERROR$			;OUTPUT ERROR MESSAGE

    160	000256	000261 				SEC			;SET CARRY

    161	000260				10$:	RETURN			;

    162

    163		000001 				.END

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

SYMBOL TABLE



CR    = 000015   	C.DEVD= 000006   	E$R20 = ****** GX	F.DSPT= ****** GX	T$MSIZ= 000054 G

CS.DIF= 000002   	C.DIRD= 000012   	E$R21 = ****** GX	HT    = 000011   	VT    = 000013

CS.DVF= 000004   	C.DSDS= 000006   	E$R22 = ****** GX	LF    = 000012   	$CMD  = ****** GX

CS.EQU= 000040   	C.FILD= 000016   	E$R23 = ****** GX	PAR$$$= 000001   	$SAVRG= ****** GX

CS.INP= 000001   	C.MKW1= 000024   	E$R24 = ****** GX	R$$11M= 000000   	$SCANI  000000RG

CS.MOR= 000020   	C.MKW2= 000026   	FF    = 000014   	SCANO   000016R  	$SCANO  000010RG

CS.NMF= 000001   	C.SIZE= 000054   	F$DEVL= 000020 G 	SPA   = 000040   	$SYNTX  000216RG

CS.OUT= 000002   	C.STAT= 000001   	F$DIRL= 000037 G 	S$V1  = ****** GX	.CSI1 = ****** G

CS.WLD= 000010   	C.SWAD= 000022   	F$FILL= 000021 G 	S$V2  = ****** GX	.CSI2 = ****** G

C.CMLD= 000002   	C.TYPR= 000000



. ABS.	000000	   000

      	000262	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  1350 WORDS  ( 6 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:08

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

