RTBIN	MACRO M1110  21-AUG-78 23:24  PAGE 2





      1						.TITLE	RTBIN

      2						.IDENT	/00/

      3

      4					;

      5					; COPYRIGHT   1978,  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 23-MAR-78

     22					;

     23					; RTB PROGRAM INITIALIZATION

     24					;

     25					; MACRO LIBRARY CALLS

     26					;

     27

     28						.MCALL	CSI$,FINIT$

     29

     30	000000					CSI$		; DEFINE CSI BLOCK OFFSETS

     31

     32					;

     33					; LOCAL DATA

     34					;

     35					; PROMPT STRING

     36					;

     37

     38	000000	   012 	   122 	   124 	PRMPT:	.ASCII	<012>/RTB>/

	000003	   102 	   076

     39		000005 			PRMLG=.-PRMPT

     40

     41						.EVEN

     42

     43					;+

     44					; **-$RTBIN-INITIALIZE RTB PROGRAM STORAGE

     45					;

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

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

     48					;

     49					; INPUTS:

     50					;

     51					;	NONE

     52					;

     53					; OUTPUTS:

     54					;

     55					;	THE INITIAL STATE OF ALL STORAGE IS ESTABLISHED

     56					;

RTBIN	MACRO M1110  21-AUG-78 23:24  PAGE 2-1





     57					;

     58					;	FILENAME BLOCKS ARE SETUP FOR THE INPUT FILE AND OUTPUT DEVICE

     59					;

     60					;-

     61

     62	000006				$RTBIN::			;

     63	000006					SAVRG			; SAVE THE NONVOLATILE REGISTERS

     64	000012					FINIT$			;

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

     66	000022				10$:				;

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

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

     69	000032				20$:				;

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

     71	000034					SOB	R1,20$		; ...

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

     73	000046	012704 	000000G			MOV	#$LNDES,R4	; GET ADDRESS OF LINE DESCRIPTOR

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

     75	000056	012701 	000000'			MOV	#PRMPT,R1	; GET ADDRESS OF PROMPT STRING

     76	000062	012702 	000005 			MOV	#PRMLG,R2	; GET LENGTH OF STRING

     77	000066					CALL	$CMLIO		; READ COMMAND LINE INPUT

     78	000072	103510 				BCS	100$		; IF C/S END-OF-FILE

     79	000074	010114 				MOV	R1,(R4)		; SET COMMAND LINE DESCRIPTOR

     80	000076	010064 	000002 			MOV	R0,2(R4)	; ...

     81	000102	010400 				MOV	R4,R0		; GET ADDRESS OF LINE DESCRIPTOR

     82	000104	010601 				MOV	SP,R1		; SET ADDRESS OF TEMP. BUFFER

     83	000106					CALL	$SYNTX		; ANALYZE SYNTAX

     84	000112	103743 				BCS	10$		; IF C/S SYNTAX ERROR

     85	000114	012700 	000000G			MOV	#$OUFDB,R0	; POINT TO OUTPUT FDB

     86	000120	010601 				MOV	SP,R1		; SET TEMP. BUFFER ADDRESS

     87	000122	005002 				CLR	R2		; NO OUTPUT FILE SWITCHES

     88	000124					CALL	$SCANO		; SCAN FOR OUTPUT FILE

     89	000130	103423 				BCS	35$		; IF C/S NO OUTPUT FILE

     90	000132	005700 				TST	R0		; MULTIPLE OUTPUT FILES SPECIFIED?

     91	000134	001421 				BEQ	35$		; IF EQ YES

     92	000136	005003 				CLR	R3		; CLEAR STRING LENGTH FLAG

     93	000140	056603 	000012 			BIS	C.DIRD(SP),R3	; INCLUDE LENGTH OF DIRECTORY STRING

     94	000144	056603 	000016 			BIS	C.FILD(SP),R3	; INCLUDE LENGTH OF FILE NAME STRING

     95	000150	001013 				BNE	35$		; IF NE ERROR

     96	000152				30$:				;

     97	000152	012700 	000000G			MOV	#$OUFDB,R0	; POINT TO OUTPUT FILE FDB

     98	000156	012701 	000000C			MOV	#$OUFDB+F.FNB,R1 ; POINT TO FILE NAME BLOCK

     99	000162	016002 	000000G			MOV	F.DSPT(R0),R2	; POINT TO DATASET DESCRIPTOR

    100	000166	016003 	000000G			MOV	F.DFNB(R0),R3	; POINT TO DEFAULT FILE NAME BLOCK

    101	000172					CALL	.PRSDV		; PARSE DEVICE NAME

    102	000176	103007 				BCC	50$		; IF C/CLEAR OK

    103	000200				35$:				;

    104	000200					ERROR$	E$R25,S$V1,R4	; REPORT INCORRECT FILE SPECIFICATION

    105	000214	000702 				BR	10$		; GO AGAIN

    106	000216				50$:				;

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

    108	000222	010601 				MOV	SP,R1		; COPY ADDRESS OF TEMP BUFFER

    109	000224	005002 				CLR	R2		; NO INPUT FILE SWITCH

    110	000226					CALL	$SCANI		; SCAN FOR INPUT FILE

    111	000232	103007 				BCC	60$		; IF C/C HAVE INPUT FILE SPECIFICATION

    112	000234					ERROR$	E$R27,S$V1,R4	; MISSING INPUT FILE

    113	000250	000664 				BR	10$		;

RTBIN	MACRO M1110  21-AUG-78 23:24  PAGE 2-2





    114	000252				60$:				;

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

    116	000256					CALL	PRFND		; PARSE/FIND INPUT FILE

    117	000262	103657 				BCS	10$		; IF C/S TRY AGAIN

    118	000264				70$:				;

    119	000264	005700 				TST	R0		; TOO MANY FILES SPECIFIED?

    120	000266	001007 				BNE	80$		; IF NE NO

    121	000270					ERROR$	E$R29,S$V1,R4	; TOO MANY INPUT FILES SPECIFIED

    122	000304	000646 				BR	10$		; TRY AGAIN

    123	000306				80$:				;

    124	000306	062706 	000000G			ADD	#T$MSIZ,SP	; CLEAN STACK

    125	000312					RETURN			;

    126

    127					;

    128					; END-OF-FILE DURING COMMAND INPUT

    129					;

    130

    131	000314				100$:				;

    132	000314	000167 	000000G			JMP	$EXIT		; EXIT

    133

    134					;

    135					; PARSE/FIND AN INPUT FILE

    136					;

    137

    138						.ENABL	LSB

    139

    140	000320				PRFND:				;

    141	000320					CALL	PARSE		; PARSE FILENAME

    142	000324	103432 				BCS	20$		; IF C/S ERROR

    143	000326					CALL	.FIND		; FIND FILE

    144	000332	103027 				BCC	20$		; IF C/C FOUND FILE OK

    145	000334	010102 				MOV	R1,R2		; COPY ADDRESS OF FNB

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

    147	000342	000415 				BR	10$		;

    148

    149					;

    150					; PARSE FILE NAME

    151					;

    152

    153	000344				PARSE:				;

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

    155	000350	060001 				ADD	R0,R1		; POINT TO FILENAME BLOCK

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

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

    158	000362					CALL	.PARSE		; PARSE FILENAME

    159	000366	103011 				BCC	20$		; IF C/C OK

    160	000370	010102 				MOV	R1,R2		; COPY ADDRESS OF FNB

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

    162	000376				10$:				;

    163	000376	062702 	000000G			ADD	#N.FNAM,R2	; POINT TO FILENAME

    164	000402					ERROR$			; REPORT ERROR

    165	000410	000261 				SEC			; SET CARRY

    166	000412				20$:				;

    167	000412					RETURN			;

    168

    169		000001 				.END

RTBIN	MACRO M1110  21-AUG-78 23:24  PAGE 2-3

SYMBOL TABLE



CR    = 000015   	C.DSDS= 000006   	E$R29 = ****** GX	R$$11M= 000000   	$OUFDB= ****** GX

CS.DIF= 000002   	C.FILD= 000016   	FF    = 000014   	SPA   = 000040   	$RTBIN  000006RG

CS.DVF= 000004   	C.MKW1= 000024   	F.DFNB= ****** GX	S$V1  = ****** GX	$SAVRG= ****** GX

CS.EQU= 000040   	C.MKW2= 000026   	F.DSPT= ****** GX	T$MSIZ= ****** GX	$SCANI= ****** GX

CS.INP= 000001   	C.SIZE= 000054   	F.FNB = ****** GX	VT    = 000013   	$SCANO= ****** GX

CS.MOR= 000020   	C.STAT= 000001   	HT    = 000011   	$CLRBG= ****** GX	$SWTCH= ****** GX

CS.NMF= 000001   	C.SWAD= 000022   	LF    = 000012   	$CMD  = ****** GX	$SYNTX= ****** GX

CS.OUT= 000002   	C.TYPR= 000000   	N.FNAM= ****** GX	$CMLIO= ****** GX	$$    = 000001

CS.WLD= 000010   	E$R11 = ****** GX	PARSE   000344R  	$EXIT = ****** GX	.FIND = ****** GX

C$LRSZ= ****** GX	E$R25 = ****** GX	PRFND   000320R  	$INFDB= ****** GX	.FINIT= ****** G

C.CMLD= 000002   	E$R26 = ****** GX	PRMLG = 000005   	$INISW= ****** GX	.PARSE= ****** GX

C.DEVD= 000006   	E$R27 = ****** GX	PRMPT   000000R  	$LNDES= ****** GX	.PRSDV= ****** GX

C.DIRD= 000012



. ABS.	000000	   000

      	000414	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  1209 WORDS  ( 5 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:09

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

