FCMIN	MACRO M1110  21-AUG-78 23:22  PAGE 2





      1						.TITLE	FCMIN

      2						.IDENT	/00/

      3

      4					;

      5					; COPYRIGHT   1977,  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 15-OCT-77

     22					;

     23					; FCM PROGRAM INITIALIZATION/

     24					;

     25					; MACRO LIBRARY CALLS

     26					;

     27

     28						.MCALL	FINIT$

     29

     30					;

     31					; LOCAL DATA

     32					;

     33					; PROMPT STRING

     34					;

     35

     36	000000	   012 	   106 	   103 	PRMPT:	.ASCII	<012>/FCM>/

	000003	   115 	   076

     37		000005 			PRMLG=.-PRMPT

     38

     39						.EVEN

     40

     41					;+

     42					; **-$FCMIN-INITIALIZE FCM PROGRAM STORAGE

     43					;

     44					;  THIS SUBROUTINE IS CALLED TO PERFORM ALL STORAGE INITIALIZA-

     45					; TION AND PARSE THE COMMAND LINE INPUT FILE SPECIFICATIONS.

     46					;

     47					; INPUTS:

     48					;

     49					;	NONE

     50					;

     51					; OUTPUTS:

     52					;

     53					;	THE INITIAL STATE OF ALL STORAGE IS ESTABLISHED

     54					;

     55					;

     56					;	FILENAME BLOCKS ARE SETUP FOR THE CME, TASK AND OUTPUT FILES.

FCMIN	MACRO M1110  21-AUG-78 23:22  PAGE 2-1





     57					;

     58					;-

     59

     60	000006				$FCMIN::			;

     61	000006					SAVRG			; SAVE THE NONVOLATILE REGISTERS

     62	000012					FINIT$			;

     63	000016	162706 	000000G			SUB	#T$MSIZ,SP	; ALLOCATE TEMP. BUFFER ON STACK

     64	000022				10$:				;

     65	000022	012700 	000000G			MOV	#$CLRBG,R0	; GET START OF AREA TO CLEAR

     66	000026	012701 	000000C			MOV	#C$LRSZ/2,R1	; GET NUMBER OF WORDS TO CLEAR

     67	000032				20$:				;

     68	000032	005020 				CLR	(R0)+		; CLEAR SPECIFIED MEMORY LOCATIONS

     69	000034					SOB	R1,20$		; ...

     70	000040	016767 	000000G	000000G		MOV	$INISW,$SWTCH	; INITIALIZE SWITCH STATE

     71	000046					CALL	$INIDM		; INITIALIZE MEMORY

     72	000052	012704 	000000G			MOV	#$LNDES,R4	; GET ADDRESS OF LINE DESCRIPTOR

     73	000056	012700 	000000G			MOV	#$CMD,R0	; POINT TO COMMAND LINE CONTROL BLOCK

     74	000062	012701 	000000'			MOV	#PRMPT,R1	; GET ADDRESS OF PROMPT STRING

     75	000066	012702 	000005 			MOV	#PRMLG,R2	; GET LENGTH OF STRING

     76	000072					CALL	$CMLIO		; READ COMMAND LINE INPUT

     77	000076	103525 				BCS	100$		; IF C/S END-OF-FILE

     78	000100	010114 				MOV	R1,(R4)		; SET COMMAND LINE DESCRIPTOR

     79	000102	010064 	000002 			MOV	R0,2(R4)	; ...

     80	000106	010400 				MOV	R4,R0		; GET ADDRESS OF LINE DESCRIPTOR

     81	000110	010601 				MOV	SP,R1		; SET ADDRESS OF TEMP. BUFFER

     82	000112					CALL	$SYNTX		; ANALYZE SYNTAX

     83	000116	103741 				BCS	10$		; IF C/S SYNTAX ERROR

     84	000120	012700 	000000G			MOV	#$OUFDB,R0	; POINT TO OUTPUT FDB

     85	000124	010601 				MOV	SP,R1		; SET TEMP. BUFFER ADDRESS

     86	000126	012702 	000000G			MOV	#$OUSWT,R2	; POINT TO SWITCH LIST

     87	000132					CALL	$SCANO		; SCAN FOR OUTPUT FILE

     88	000136	103421 				BCS	50$		; IF C/S NO OUTPUT FILE

     89	000140	052767 	000000G	000000G		BIS	#OU$FL,$SWTCH	; FLAG OUTPUT FILE PRESENT

     90	000146	005700 				TST	R0		; MULTIPLE OUTPUT FILES SPECIFIED?

     91	000150	001007 				BNE	30$		; IF NE NO

     92	000152					ERROR$	E$R25,S$V1,R4	; REPORT ERROR

     93	000166	000715 				BR	10$		; TRY AGAIN

     94	000170				30$:				;

     95	000170	012700 	000000G			MOV	#$OUFDB,R0	; POINT TO OUTPUT FILE FDB

     96	000174					CALL	PARSE		; PARSE FILE NAME

     97	000200	103710 				BCS	10$		; IF C/S ILLEGAL FILE SPECIFICATION

     98	000202				50$:				;

     99	000202	012700 	000000G			MOV	#$INFDB,R0	; SET ADDRESS OF INPUT FILE FDB

    100	000206	010601 				MOV	SP,R1		; COPY ADDRESS OF TEMP BUFFER

    101	000210	012702 	000000G			MOV	#$INSWT,R2	; SET ADDRESS OF FILE SWITCH TABLE

    102	000214					CALL	$SCANI		; SCAN FOR INPUT FILE

    103	000220	103007 				BCC	60$		; IF C/C HAVE INPUT FILE SPECIFICATION

    104	000222					ERROR$	E$R27,S$V1,R4	; MISSING INPUT FILE

    105	000236	000671 				BR	10$		;

    106	000240				60$:				;

    107	000240	012700 	000000G			MOV	#$INFDB,R0	; GET ADDRESS OF INPUT FILE FDB

    108	000244					CALL	PRFND		; PARSE/FIND INPUT FILE

    109	000250	103664 				BCS	10$		; IF C/S TRY AGAIN

    110	000252	012700 	000000G			MOV	#$TKFDB,R0	; POINT TO TASK IMAGE FILE FDB

    111	000256	010601 				MOV	SP,R1		; POINT TO TEMP. BUFFER

    112	000260	012702 	000000G			MOV	#$INSWT,R2	; SET SWITCH TABLE ADDRESS

    113	000264					CALL	$SCANI		; SCAN FOR TASK IMAGE INPUT FILE

FCMIN	MACRO M1110  21-AUG-78 23:22  PAGE 2-2





    114	000270	103007 				BCC	70$		; IF C/C HAVE FILE SPECIFICATION

    115	000272					ERROR$	E$R28,S$V1,R4	; MISSING CORRECTION FILE

    116	000306	000645 				BR	10$		; GO AGAIN

    117	000310				70$:				;

    118	000310	005700 				TST	R0		; TOO MANY FILES SPECIFIED?

    119	000312	001007 				BNE	80$		; IF NE NO

    120	000314					ERROR$	E$R29,S$V1,R4	; TOO MANY INPUT FILES SPECIFIED

    121	000330	000634 				BR	10$		; TRY AGAIN

    122	000332				80$:				;

    123	000332	012700 	000000G			MOV	#$TKFDB,R0	; POINT TO TASK FILE FDB

    124	000336					CALL	PRFND		; PARSE/FIND CORRECTION FILE

    125	000342	103627 				BCS	10$		; IF C/S UNABLE TO LOCATE FILE

    126	000344	062706 	000000G			ADD	#T$MSIZ,SP	; CLEAN STACK

    127	000350					RETURN			;

    128

    129					;

    130					; END-OF-FILE DURING COMMAND INPUT

    131					;

    132

    133	000352				100$:				;

    134	000352	000167 	000000G			JMP	$EXIT		; EXIT

    135

    136					;

    137					; PARSE/FIND AN INPUT FILE

    138					;

    139

    140						.ENABL	LSB

    141

    142	000356				PRFND:				;

    143	000356					CALL	PARSE		; PARSE FILENAME

    144	000362	103432 				BCS	20$		; IF C/S ERROR

    145	000364					CALL	.FIND		; FIND FILE

    146	000370	103027 				BCC	20$		; IF C/C FOUND FILE OK

    147	000372	010102 				MOV	R1,R2		; COPY ADDRESS OF FNB

    148	000374	012701 	000000C			MOV	#S$V1*400!E$R11,R1 ; SET ERROR/SEVERITY

    149	000400	000415 				BR	10$		;

    150

    151					;

    152					; PARSE FILE NAME

    153					;

    154

    155	000402				PARSE:				;

    156	000402	012701 	000000G			MOV	#F.FNB,R1	; GET OFFSET TO FILENAME BLOCK

    157	000406	060001 				ADD	R0,R1		; POINT TO FILENAME BLOCK

    158	000410	016002 	000000G			MOV	F.DSPT(R0),R2	; GET ADDRESS OF DATASET DESCRIPTOR

    159	000414	016003 	000000G			MOV	F.DFNB(R0),R3	; GET ADDRESS OF DEFAULT NAME BLOCK

    160	000420					CALL	.PARSE		; PARSE FILENAME

    161	000424	103011 				BCC	20$		; IF C/C OK

    162	000426	010102 				MOV	R1,R2		; COPY ADDRESS OF FNB

    163	000430	012701 	000000C			MOV	#S$V1*400!E$R26,R1 ; SET ERROR/SEVERITY

    164	000434				10$:				;

    165	000434	062702 	000000G			ADD	#N.FNAM,R2	; POINT TO FILENAME

    166	000440					ERROR$			; REPORT ERROR

    167	000446	000261 				SEC			; SET CARRY

    168	000450				20$:				;

    169	000450					RETURN			;

    170

FCMIN	MACRO M1110  21-AUG-78 23:22  PAGE 2-3





    171		000001 				.END

FCMIN	MACRO M1110  21-AUG-78 23:22  PAGE 2-4

SYMBOL TABLE



CR    = 000015   	F.DSPT= ****** GX	R$$11M= 000000   	$FCMIN  000006RG 	$SCANI= ****** GX

C$LRSZ= ****** GX	F.FNB = ****** GX	SPA   = 000040   	$INFDB= ****** GX	$SCANO= ****** GX

E$R11 = ****** GX	HT    = 000011   	S$V1  = ****** GX	$INIDM= ****** GX	$SWTCH= ****** GX

E$R25 = ****** GX	LF    = 000012   	T$MSIZ= ****** GX	$INISW= ****** GX	$SYNTX= ****** GX

E$R26 = ****** GX	N.FNAM= ****** GX	VT    = 000013   	$INSWT= ****** GX	$TKFDB= ****** GX

E$R27 = ****** GX	OU$FL = ****** GX	$CLRBG= ****** GX	$LNDES= ****** GX	$$    = 000001

E$R28 = ****** GX	PARSE   000402R  	$CMD  = ****** GX	$OUFDB= ****** GX	.FIND = ****** GX

E$R29 = ****** GX	PRFND   000356R  	$CMLIO= ****** GX	$OUSWT= ****** GX	.FINIT= ****** G

FF    = 000014   	PRMLG = 000005   	$EXIT = ****** GX	$SAVRG= ****** GX	.PARSE= ****** GX

F.DFNB= ****** GX	PRMPT   000000R



. ABS.	000000	   000

      	000452	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  897 WORDS  ( 4 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:07

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

