FORMAT	MACRO M1110  22-AUG-78 02:12

TABLE OF CONTENTS



     1-  300	OBJECT LANGUAGE DEFS

FORMAT	MACRO M1110  22-AUG-78 02:12  PAGE 1





    100						.TITLE	FORMAT

    200						.IDENT	/X0300/

    300						.SBTTL	OBJECT LANGUAGE DEFS

FORMAT	MACRO M1110  22-AUG-78 02:12  PAGE 3





      1					; COPYRIGHT (C) 1976, 1977

      2					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

      3					;

      4					; THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

      5					; SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

      6					; SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

      7					; OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

      8					; AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

      9					; AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

     10					; OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

     11					;

     12					; THE INFORMATION IN THIS SOFTWARE  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 OF ITS

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

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 4





      1						.TITLE	LIBIN

      2						.IDENT	/X04.08/

      3

      4					; COPYRIGHT (C) 1976, 1977, 1978

      5					; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

      6					;

      7					; THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

      8					; SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

      9					; SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

     10					; OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

     11					; AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

     12					; AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

     13					; OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

     14					;

     15					; THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

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

     17					; EQUIPMENT CORPORATION.

     18					;

     19					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

     20					; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     21					;

     22					; VERSION X04.01

     23					;

     24					; WRITTEN BY:

     25					;	GEORGE W. BERRY

     26					;

     27					; MODIFIED BY:

     28					;	C.A. D'ELIA	10-JUN-74

     29					;	C.A. D'ELIA	02-JUL-74  (VIRTUAL TABLES)

     30					;	THOMAS J. MILLER 29-OCT-74

     31					;

     32					;	T. J. MILLER 22-JAN-76

     33					;

     34					;		TM002 -- ADDITION OF ENTRY POINT SWITCH (/EP).

     35					;

     36					;

     37

     38					;

     39					; MACRO CALLS

     40					;

     41					;	K.D. MORSE 01-DEC-76

     42					;

     43					;		KM001 -- FIX BUG IN /SZ AND SET TABLES ON BLOCK BOUNDARIES

     44					;

     45					;	K.D. MORSE 17-JAN-77

     46					;

     47					;		KM002 -- FIX BUG IN CONCATENATED GSD HANDLING

     48					;

     49					;	K.D. MORSE 17-JAN-77

     50					;

     51					;		KM003 -- IMPLEMENT ENTRY POINT GSD TYPE 2

     52					;

     53					;	K.D. MORSE 27-APR-77

     54					;

     55					;		KM004 -- OUTPUT WARNING MESSAGE IF SEVERITY LEVEL IN

     56					;				END OF MODULE RECORD IS NOT ZERO

     57					;

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 4-1





     58					;	K.D. MORSE 27-MAY-77

     59					;

     60					;		KM005 -- FIX BUG ON WEAK REFERENCES

     61					;

     62					;	K.D. MORSE 13-JUNE-77

     63					;

     64					;		KM006 -- CHANGE SEVERITY LEVEL ERROR MESSAGE TO SV0

     65					;

     66					;	K.D. MORSE 23-MAY-78

     67					;

     68					;		KM007 -- ADD GSD TYPE 3, PROCEDURE DEFINITION WITH FORMAL

     69					;			 ARGUMENTS

     70					;

     71					;	K.D. MORSE 03-AUG-78

     72					;

     73					;		KM008 -- FIX BUG IN /-EP GSD CODE.

     74					;

     75

     76						.MCALL	IOERR$

     77	000000					IOERR$

     78						.MCALL	FDOFF$

     79	000000					FDOFF$	DEF$L

     80						.MCALL	CSI$

     81	000000					CSI$

     82						.MCALL	FCSBT$

     83	000000					FCSBT$

     84

     85						.MCALL	CLOSE$,GTIM$S,PUT$

     86

     87

     94

     95						.MCALL	GET$S

     96

     97

     99

    100

    101					;

    102					; LOCAL DATA

    103					;

    104

    105	000000				MHSZ:	.BLKW	1		;ACTUAL MODULE HEADER SIZE

    106	000002				DATE:	.BLKW	8.		;DATE + TIME VALUE FROM

    107		000022 			XXXSIZ=S$MXLN+1+2		;+++STAR CALC XXXSIZ

    108	000022				XXX:	.BLKB	XXXSIZ		;+++STAR

    109		000022'			ID	=XXX			;MODULE .IDENT

    110		000042'			ENDFLG	=XXX+S$MXLN+1		;+++STAR END FLG

    111	000044				MDEPTH:	.BLKW	1		;+++STAR MACRO DEFINITION DEPTH COUNTER

    112	000046				MACNAM:	.BLKB	S$MXLN+1	;+++STAR MACRO NAME BUFFER

    113	000066	000000 				.WORD	0		;NON-RAD50 CHARACTER STOPPER

    114									;   0=READING MODULE

    115									;   1=EOF EXPECTED

    116

    117	000000					.PSECT	PUTCOM,D

    118

    119		000024 			RPSIZ=S$MXLN+1+4		;+++STAR

    120	000000				RPBLK:	.BLKB	RPSIZ		;+++STAR MODULE REPLACE INFO BLOCK -- CLEARED

    121									;... INITIALLY & FILLED IN AS FOLLOWS:

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 4-2





    122		000000'			RPMNT==RPBLK			;  RPMNT-NAME OF MNT REPLACED

    123		000020'			RPMHD==RPBLK+S$MXLN+1		;+++STAR   RPMHD-ADDR (VBN) OF MODULE REPLACED

    124

    125

    126	000024				LASTEP::.BLKB	S$MXLN+1	;+++STAR LAST EPT ENTRY REPLACED ...

    127									;... IN CASE OF REPLACE ERROR

    128

    129	000044				VBLOCK:	.BLKW	3		;+++KM004 CMD BLOCK FOR $EDMSG

    130

    131	000052				MODNAM:	.BLKB	S$MXLN+1	;+++KM004 CURRENT MODULE NAME

    132

    133	000070					.PSECT

    134

    135					;

    136					; REPLACE MESSAGE

    137					;

    138

    139						.NLIST	BEX

    140	000070	   015 	   012 	   115 	RPM:	.ASCIZ	<15><12>/MODULE "%VA" REPLACED/<15><12> ;+++STAR

    141					;

    142					; KEY WORD STRINGS

    143					;

    144	000122	   115 	   101 	   103 	MACSTR:	.ASCIZ	/MACRO/

    145	000130	   122 	   105 	   120 	REPSTR:	.ASCIZ	/REPT/

    146	000135	   111 	   122 	   120 	IRCSTR:	.ASCIZ	/IRPC/

    147	000142	   111 	   122 	   120 	IRSTR:	.ASCIZ	/IRP/

    148	000146	   105 	   116 	   104 	ENMSTR:	.ASCIZ	/ENDM/

    149	000153	   105 	   116 	   104 	ENRSTR:	.ASCIZ	/ENDR/

    150						.EVEN

    151						.LIST	BEX

    152

    153

    154					;

    155					; TABLE OF TYPE DEPENDENT CO-ROUTINES (INDEXED BY TYPE)

    156					;

    157

    158	000160				INSUB:

    159	000160	001202'				.WORD	INOBJ		;OBJ TYPE - INSERT OBJ MODULES

    160	000162	057032 				.RAD50	/OBJ/		;DEFAULT EXTENSION IS OBJ

    161	000164	001700'				.WORD	INMAC		;MAC TYPE - INSERT MAC MODULES

    162	000166	050572 				.RAD50	/MAR/		;DEFAULT EXTENSION IS MAR

    163

    164

    165					;+

    166					; **-$INS-INSERT FUNCTION

    167					;

    168					; THIS ROUTINE PERFORMS AN INSERT OF SPECIFIED

    169					; INPUT MODULES (WHERE THE SPECIFICATION IS

    170					; TAKEN FROM THE COMMAND INPUT DEVICE) INTO THE

    171					; LIBRARY.  THE MNT AND EPT ARE UPDATED.

    172					;

    173					; INPUTS:

    174					;

    175					;	NONE

    176					;

    177					; OUTPUTS:

    178					;

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 4-3





    179					;	NONE

    180					;

    181					;-

    182	000170				$INS::	SAVRG			;SAVE R3-R5

    183	000174	016700 	000000G			MOV	$INPPT,R0	;POINT TO INPUT FDB

    184	000200	012760 	000004 	000016 		MOV	#FD.PLC,F.RACC(R0) ;SET TO PARTIAL LOCATE MODE

    185	000206	004567 	000000G		IN10:	JSR	R5,$CLEAR	;CLEAR TEMP AREA

    186	000212	000022'				.WORD	XXX

    187	000214	000011 				.WORD	XXXSIZ/2	;+++STAR

    188

    189

    196

    197	000216	005000 				CLR	R0		;OUTPUT TO CMO VIA QUEUE I/O

    198

    199

    201

    202

    203	000220					CALL	$OUT		;INIT MESSAGE OUTPUT ROUTINE

    204	000224	016700 	000000G			MOV	$INPPT,R0	;GET INPUT FILE CONTROL BLOCK ADDRESS

    205	000230	016760 	000000G	000000G		MOV	$SWTCH,R$SWTH(R0) ;SET UP /RP BIT

    206	000236	012701 	000000G			MOV	#$CSIBK,R1	;GET CSI BLOCK ADDRESS

    207	000242					CALL	$SCANI		;SCAN FOR AN INPUT FILE

    208	000246	103004 				BCC	5$		;BRANCH IF FILE SPEC ENCOUNTERED

    209

    210	000250	005067 	000000G			CLR	$OPNFL		;INDICATE LIBRARY IS ONLY OPEN FILE

    211	000254					CALLR	$WTHD		;REWRITE MODIFIED HEADER

    212									;AND RETURN THROUGH  $WTHD***

    213

    214	000260	012701 	000006 		5$:	MOV	#FO.UPD,R1	;SPECIFY OPEN FOR UPDATE

    215	000264					CALL	$RDHD		;READ HEADER, EPT AND MNT

    216	000270	116701 	000000G			MOVB	L$TYP,R1	;GET FILE TYPE

    217	000274	006301 				ASL	R1		;CONVERT IT TO A TABLE OFFSET

    218	000276	006301 				ASL	R1

    219	000300	016167 	000162'	000014G		MOV	INSUB+2(R1),INPNAM+N.FTYP ;MOVE DEFAULT EXT TO NMBLK

    220	000306					CALL	@INSUB(R1)	;INIT INSERT TYPE-DEPENDENT CO-ROUTINE

    221	000312	016700 	000000G			MOV	$INPPT,R0

    222	000316	010067 	000000G			MOV	R0,$OPNFL	;INDICATE OPEN FILE ON 'INPPT'

    223

    224

    231

    232	000322	012701 	000001 			MOV	#FO.RD,R1	;SPECIFY OPEN FOR READ

    233	000326					CALL	$OPEN		;PARSE FILENAME AND OPEN FILE

    234

    235

    237

    238

    239	000332	103006 				BCC	IN20		;BRANCH IF OK

    240	000334	012701 				MOV	(PC)+,R1

    241	000336	   000G	   000G			.BYTE	E$R11,S$V2	;CAN'T OPEN FILE

    242	000340	016002 	000000G		ERROR:	MOV	R$NAME(R0),R2

    243	000344	000167 	000000G		ERRXIT:	JMP	$ERMSG		;FATAL ERROR EXIT.

    244

    245

    246	000350				IN20:

    247	000350	012702 	000012 			MOV	#RPSIZ/2,R2	;+++STAR GET BLOCK SIZE

    248	000354	012701 	000000'			MOV	#RPBLK,R1	;+++STAR GET BLOCK ADDR

    249	000360				5$:

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 4-4





    250	000360	005021 				CLR	(R1)+		;+++STAR ZERO LOCATION

    251	000362					SOB	R2,5$		;+++STAR LOOP TIL DONE

    252	000366	032760 	000000G	000000G		BIT	#RP$SW,R$SWTH(R0) ;/RP INDICATED

    253	000374	001402 				BEQ	1$		;BRANCH IF NOT

    254	000376	005267 	000020'			INC	RPMHD		;PERMIT /RP

    255	000402	016700 	000000G		1$:	MOV	$LIBPT,R0	;GET LIBRARY FDB

    256	000406	112760 	000002 	000000 		MOVB	#R.VAR,F.RTYP(R0) ;CHANGE LIB TO VARIABLE LENGTH RECORDS

    257	000414	105060 	000001 			CLRB	F.RATT(R0)	;++KM001 CAN CROSS BLOCK BOUNDRIES

    258	000420	005001 				CLR	R1		;HIGH ORDER VIRTUAL BLOCK

    259	000422	016702 	000000G			MOV	L$NX,R2		;LOW ORDER VIRTUAL BLOCK

    260	000426	016703 	000002G			MOV	L$NX+2,R3	;BYTE WITHIN BLOCK

    261	000432					CALL	.POINT		;CALL THE .POINT SUBROUTINE

    262	000436	103007 				BCC	25$		;BRANCH IF OK

    263	000440	122760 	177766 	000052 		CMPB	#IE.EOF,F.ERR(R0) ;IGNORE EOF ERROR IF IT OCCURS

    264	000446	001403 				BEQ	25$		;BRANCH IF EOF ERROR

    265

    266	000450	012701 			24$:	MOV	(PC)+,R1	;INDICATE POSITIONING ERROR

    267	000452	   000G	   000G			.BYTE	E$R14,S$V2

    268	000454	000731 				BR	ERROR

    269

    270	000456	004567 	000000G		25$:	JSR	R5,$CLEAR	;ZERO MODULE HEADER RECORD

    271	000462	000000G				.WORD	$MHBUF

    272	000464	000000C				.WORD	MHSIZE/2	;+++STAR

    273	000466					PUT$	R0,#$MHST,MHSZ	;WRITE MODULE HEADER RECORD

    274	000506	103436 				BCS	40$		;PUT ERROR

    275	000510	016700 	000000G		30$:	MOV	$INPPT,R0	;PUT ADDR OF INPUT FDB IN R0

    276	000514	105060 	000001 			CLRB	F.RATT(R0)	;++KM001 CAN CROSS BLOCK BOUNDRIES

    277	000520	005767 	177316 			TST	ENDFLG		;TEST FOR OMITTING GET

    278	000524	003006 				BGT	35$		;BRANCH...FIRST RECORD ALREADY READ

    279

    280

    287

    288	000526					GET$S	R0		;GET INPUT RECORD

    289

    290

    292

    293

    294	000532	103003 				BCC	35$

    295	000534	012701 			31$:	MOV	(PC)+,R1	;FATAL READ ERROR

    296	000536	   000G	   000G			.BYTE	E$R01,S$V2

    297	000540	000677 				BR	ERROR		;FATAL EXIT

    298

    299	000542				35$:	CALL	@(SP)+		;SCAN RECORD JUST READ

    300	000544	016701 	000000G			MOV	$INPPT,R1

    301	000550	016700 	000000G			MOV	$LIBPT,R0

    302	000554	005761 	000024 			TST	F.NRBD(R1)	;NULL LINE?

    303	000560	001753 				BEQ	30$		;SKIP PUT IF SO

    304	000562					PUT$	R0,F.NRBD+2(R1),F.NRBD(R1) ;WRITE OUT RECORD

    305	000602	103003 				BCC	45$

    306	000604	012701 			40$:	MOV	(PC)+,R1	;WRITE ERROR

    307	000606	   000G	   000G			.BYTE	E$R02,S$V2

    308	000610	000653 				BR	ERROR

    309

    310

    311	000612	005767 	177224 		45$:	TST	ENDFLG		;CHECK END FLAG

    312	000616	003734 				BLE	30$		;IF NOT SET, CONTINUE READING MODULE

    313	000620	012704 	000000G			MOV	#$MHST,R4	;BUILD MODULE HEADER RECORD

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 4-5





    314	000624	005024 				CLR	(R4)+		;CLEAR MODULE STATUS

    315	000626	032767 	000000G	000000C		BIT	#SS$SW,R$SWTH+INPPT  ;WAS /SS SWITCH SPECIFIED?

    316	000634	001402 				BEQ	50$		;BRANCH IF NOT

    317	000636	105264 	177777 			INCB	-1(R4)		;YES--SET SELECTIVE SEARCH ATTRIBUTE

    318	000642	012705 	000000G		50$:	MOV	#L$NX,R5	;GET ADDRESS OF MODULE INSERT

    319	000646					CALL	.MARK		;COMPUTE CURRENT VBN&BYTE-IN-BLOCK

    320	000652	010346 				MOV	R3,-(SP)	;SAVE BYTE IN BLOCK

    321	000654	162502 				SUB	(R5)+,R2	;# OF BLOCKS

    322

    323

    330

    331	000656	000302 				SWAB	R2		;MULTIPLY R2 BY 256.

    332	000660	010203 				MOV	R2,R3		;MAKE IT DOUBLE WORD RESULT

    333	000662	105003 				CLRB	R3		;CLEAR LOW HALF OF R3

    334	000664	040302 				BIC	R3,R2		;CLEAR HIGH HALF OF R2

    335	000666	006303 				ASL	R3		;FINAL RESULT IS MULTIPLIED BY 512.

    336	000670	006102 				ROL	R2		;DOUBLE WORD

    337

    338

    340

    341

    342	000672	061603 				ADD	(SP),R3		;ADD BYTE-IN-BLOCK INTO MODULE SIZE

    343	000674	005502 				ADC	R2		;(DOUBLE PRECISION)

    344	000676	161503 				SUB	(R5),R3		; - BYTE IN RECORD OF START

    345	000700	005602 				SBC	R2		;(DOUBLE PRECISION)

    346	000702	010224 				MOV	R2,(R4)+	;AND SAVE MODULE SIZE

    347	000704	010324 				MOV	R3,(R4)+

    348	000706	012701 	000002'			MOV	#DATE,R1

    349	000712					GTIM$S	R1

    350	000722	012703 	000000G			MOV	#L$DAT,R3	;STORE DATE IN BOTH LIBRARY HEADER

    351	000726	011124 				MOV	(R1),(R4)+	;AND MODULE HEADER

    352	000730	012123 				MOV	(R1)+,(R3)+

    353	000732	011124 				MOV	(R1),(R4)+

    354	000734	012123 				MOV	(R1)+,(R3)+

    355	000736	011124 				MOV	(R1),(R4)+

    356	000740	012123 				MOV	(R1)+,(R3)+

    357	000742	012123 				MOV	(R1)+,(R3)+

    358	000744	012123 				MOV	(R1)+,(R3)+

    359	000746	011113 				MOV	(R1),(R3)

    360	000750	012702 	000022'			MOV	#ID,R2		;+++STAR ADDR OF WHERE TO STORE ID

    361	000754	111203 				MOVB	(R2),R3		;+++STAR LENGTH OF ID

    362	000756	005203 				INC	R3		;+++STAR ADD 1 FOR COUNT

    363	000760				60$:

    364	000760	112224 				MOVB	(R2)+,(R4)+	;+++STAR COPY ID INTO HEADER

    365	000762					SOB	R3,60$		;+++STAR LOOP TIL DONE

    366

    367	000766	005001 				CLR	R1		;GET ADDRESS OF MODULE HEADER RECORD

    368	000770	014502 				MOV	-(R5),R2

    369	000772	016503 	000002 			MOV	2(R5),R3

    370	000776	016025 	000066 			MOV	F.VBN+2(R0),(R5)+ ;SAVE NEW NEXT MODULE ADDRESS

    371	001002	012615 				MOV	(SP)+,(R5)

    372	001004					CALL	.POINT		;RESET RECORD POINTER

    373	001010	103617 				BCS	24$		;BRANCH IF POSITIONING ERROR

    374	001012					PUT$	R0,#$MHST,MHSZ	;REWRITE HEADER RECORD

    375	001032	103664 				BCS	40$		;BRANCH IF WRITE ERROR

    376	001034	026727 	000020'	000001 		CMP	RPMHD,#1	;CHECK FOR OCCURRENCE OF REPLACE

    377	001042	101431 				BLOS	18$		;BRANCH IF NONE OCCURRED

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 4-6





    378	001044	005767 	000000'			TST	RPMNT		;IF SO, CHECK FOR THE MODULE NAME

    379	001050	001002 				BNE	15$		;IF PRESENT, CONTINUE

    380	001052	000167 	000000G			JMP	EPTERR		;OTHERWISE, FORCE EPT ERROR

    381	001056				15$:

    382	001056	012702 	000020'			MOV	#RPMHD,R2	;NOW IS THE TIME TO DELETE MODULE

    383	001062					CALL	$DELM

    384	001066					CALL	$WTHD		;BEST REWRITE HEADER

    385	001072	012701 	000070'			MOV	#RPM,R1		;+++STAR ADDR OF MSG

    386	001076	012703 	000001'			MOV	#RPMNT+1,R3	;+++STAR ADDR OF NAME

    387	001102	012702 	000046'			MOV	#VBLOCK+2,R2	;+++STAR ADDR OF CMD BLOCK

    388	001106	010312 				MOV	R3,(R2)		;+++STAR GET NAME ADDR

    389	001110	005042 				CLR	-(R2)		;+++STAR ZERO COUNT

    390	001112	114312 				MOVB	-(R3),(R2)	;+++STAR GET LENGTH OF NAME

    391	001114	005000 				CLR	R0		;+++KM004 SET UP TO

    392	001116					CALL	$OUT		;+++KM004 RE-INITIALIZE OUTPUT ROUTINE

    393	001122					CALL	$OUT1

    394	001126	016700 	000000G		18$:	MOV	$INPPT,R0

    395	001132	105060 	000001 			CLRB	F.RATT(R0)	;++KM001 CAN CROSS BLOCK BOUNDRIES

    396

    397

    404

    405	001136					GET$S	R0		;MORE INPUT?

    406

    407

    409

    410

    411	001142	103402 				BCS	CLOSIN		;BRANCH IF NO MORE INPUT

    412	001144	000167 	177200 			JMP	IN20		;GET$ SUCCEEDED...GO BACK FOR MORE

    413

    414	001150				CLOSIN:	CLOSE$	R0		;CLOSE INPUT FILE

    415	001154	005726 				TST	(SP)+		;FLUSH COROUTINE ADDRESS

    416	001156					CALL	$WTHD		;WRITE OUT HEADER, EPT, MNT

    417	001162	000167 	177020 			JMP	IN10		;RETURN FOR MORE INPUT

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 5





    419					;+

    420					;

    421					; THIS CO-ROUTINE HANDLES THE OBJECT MODULE TYPE-DEPENDENT

    422					; FUNCTIONS FOR THE INSERT ($INS) PROCESSOR.

    423					;

    424					;+++STAR  THIS ROUTINE WAS REWRITTEN FOR STAR SOFTWARE

    425					;-

    426	001166				JMPTBL:

    427	001166	001266'				.WORD	MHD		;MODULE HEADER ROUTINE

    428	001170	001354'				.WORD	GSD		;GLOBAL SYMBOL ROUTINE

    429	001172	001562'				.WORD	TIR		;TEXT INFO AND RELOC ROUTINE

    430	001174	001564'				.WORD	EOM		;END OF MODULE ROUTINE

    431	001176	001652'				.WORD	DBG		;DEBUG ROUTINE

    432	001200	001656'				.WORD	LNK		;LINKER RECORD

    433					;

    434	001202				INOBJ:

    435	001202	012767 	000000G	176570 		MOV	#HS$OBJ,MHSZ	;SAVE MODULE HEADER SIZE

    436	001210				CO1:

    437	001210	005067 	176626 			CLR	ENDFLG		;RESET END OF MODULE FLAG

    438	001214				COXIT:

    439	001214					CALL	@(SP)+		;EXIT CO-ROUTINE

    440	001216	016001 	000026 			MOV	F.NRBD+2(R0),R1	;GET ADDR OF RECORD JUST READ

    441	001222	010105 				MOV	R1,R5		;R5 EQUALS

    442	001224	066005 	000024 			ADD	F.NRBD(R0),R5	;  END OF RECORD ADDR

    443	001230	116102 	000000 			MOVB	O$BJTY(R1),R2	;GET OBJECT RECORD TYPE

    444	001234	122702 	000000 			CMPB	#OB$HDR,R2	;CHECK IF THE

    445	001240	003402 				BLE	10$		; ++KM007 RECORD TYPE

    446	001242	000167 	000414 			JMP	ERROR1		; ++KM007 IS INCORRECT

    447	001246	122702 	000005 		10$:	CMPB	#OB$LNK,R2	;    OR CORRECT

    448	001252	002002 				BGE	20$		;++KM007 BR IF CORRECT

    449	001254	000167 	000402 			JMP	ERROR1		;++KM007 BR IF ERROR

    450	001260	006302 			20$:	ASL	R2		;MAKE TYPE A WORD OFFSET FOR JMP

    451	001262	000172 	001166'			JMP	@JMPTBL(R2)	;DISPATCH TO CORRECT ROUTINE

    452					;

    453					; THIS ROUTINE HANDLES THE MODULE HEADER RECORD

    454					;

    455	001266				MHD:

    456	001266	122761 	000000 	000001 		CMPB	#MH$MHD,M$HDST(R1) ;IS THIS THE MAIN HEADER RECORD

    457	001274	001026 				BNE	20$		;BR IF NO - DONE WITH MHD

    458	001276	062701 	000005 			ADD	#M$HDNM,R1	;POINT TO MODULE NAME

    459	001302	012702 	000000G			MOV	#$MNBLK,R2	;MNT DESCRIPTOR

    460	001306	012704 	000000G			MOV	#L$MA,R4	;POINT TO MNTS AVAILABLE

    461	001312					CALL	PUT		;PUT OUT MNT ENTRY

    462	001316	012703 	000052'			MOV	#MODNAM,R3	;+++KM004 GET TEMP. MODULE NAME STORAGE

    463	001322	111104 				MOVB	(R1),R4		;+++KM004 GET LENGTH OF NAME

    464	001324	005204 				INC	R4		;+++KM004 ADD IN ONE FOR LENGTH BYTE

    465	001326	112123 			5$:	MOVB	(R1)+,(R3)+	;+++KM004 STORE ASCIC STRING

    466	001330					SOB	R4,5$		;+++KM004 REPEAT FOR NAME AND LENGTH BYTE

    467	001334	012704 	000022'			MOV	#ID,R4		;ADDR OF WHERE TO PUT MODULE VERSION

    468	001340	111103 				MOVB	(R1),R3		;MODULE VERSION LENGTH IN R3

    469	001342	005203 				INC	R3		;ADD 1 FOR CHAR CNT

    470	001344				10$:

    471	001344	112124 				MOVB	(R1)+,(R4)+	;MOVE MODULE VERSION

    472	001346					SOB	R3,10$		;LOOP TIL DONE

    473	001352				20$:

    474	001352	000716 				BR	CO1		;DONE WITH MHD

    475					;

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 5-1





    476					; THIS ROUTINE HANDLES THE GLOBAL SYMBOL RECORDS

    477					;

    478	001354				GSD:

    479	001354	005201 				INC	R1		; ++KM002 POINT PAST RECORD TYPE (NOTE:

    480	001356				GSD1:				;         ALL OFFSETS FOR GSD HANDLING

    481									;	  MUST NOW BE #OFFSET-1)

    482	001356	116146 	000000 			MOVB	G$SDTY-1(R1),-(SP) ; ++KM007 REMEMBER TYPE OF GSD

    483	001362	122716 	000000 			CMPB	#GS$PSC,(SP)	; ++KM007 IS THIS A PSECT GSD

    484	001366	001454 				BEQ	20$		;BR IF YES - IGNORE IT

    485	001370	132761 	000002 	000002 		BITB	#SF$DEF,S$SFL0-1(R1) ; ++KM002 IS THIS A GSD DEFINITION

    486	001376	001453 				BEQ	30$		;BR IF NO - REFERENCE - IGNORE IT

    487	001400	132761 	000001 	000002 		BITB	#SF$WK,S$SFL0-1(R1) ; ++KM005 IS THIS A WEAK RESOLUTION

    488	001406	001052 				BNE	40$		; ++KM005 BR IF YES - IGNORE IT

    489	001410	032767 	000000G	000000C		BIT	#EP$SW,INPPT+R$SWTH ;ENTRY POINTS DESIRED

    490	001416	001046 				BNE	40$		; ++KM008 BR IF NO - IGNORE SYMBOL

    491	001420	122716 	000002 			CMPB	#GS$EPM,(SP)	; ++KM003 ENTRY POINT WITH MASK?

    492	001424	001403 				BEQ	5$		; ++KM007 YES, ADD IN MASK BYTES

    493	001426	122716 	000003 			CMPB	#GS$ARG,(SP)	; ++KM007 IS IT PROCEDURE DEF W/FORMALS?

    494	001432	001002 				BNE	6$		; ++KM007 NO, DON'T ADD IN MASK BYTES

    495	001434	062701 	000002 		5$:	ADD	#2,R1		; ++KM003 ADD IN TWO BYTES FOR MASK

    496	001440	062701 	000011 		6$:	ADD	#S$DNLN-1,R1	; ++KM002 MOVE POINTER TO NAME

    497	001444	012702 	000000G			MOV	#$EPBLK,R2	;GST DESCRIPTOR

    498	001450	012704 	000000G			MOV	#L$EA,R4	;POINT TO GSTS AVAILABLE

    499	001454					CALL	PUT		;MAKE GST ENTRY

    500	001460				10$:

    501	001460	112103 				MOVB	(R1)+,R3	;GET NAME LENGTH

    502	001462	060301 				ADD	R3,R1		;MOVE TO NEXT GSD

    503	001464	122726 	000003 			CMPB	#GS$ARG,(SP)+	; ++KM007 WAS IT PROCEDURE WITH FORMALS?

    504	001470	001010 				BNE	15$		; ++KM007 NO, DON'T ADD IN FORMAL DESCRIPTORS

    505	001472	005201 				INC	R1		; ++KM007 SKIP MIN FORMAL ARGS

    506	001474	112103 				MOVB	(R1)+,R3	; ++KM007 GET MAX FORMAL ARGS

    507	001476	001405 				BEQ	15$		; ++KM007 IF NONE, GO SEE IF MORE GSD'S

    508	001500	005201 			12$:	INC	R1		; ++KM007 SKIP ARG. VAL. CTL. BYTE

    509	001502	112102 				MOVB	(R1)+,R2	; ++KM007 GET REM. BYTE COUNT

    510	001504	060201 				ADD	R2,R1		; ++KM007 POINT TO NEXT FORMAL ARG. DESC.

    511	001506					SOB	R3,12$		; ++KM007 REPEAT FOR MAX FORMAL ARGS.

    512	001512	020105 			15$:	CMP	R1,R5		;MORE GSDS IN THIS RECORD

    513	001514	103720 				BLO	GSD1		;BR IF YES - GET THE REST

    514	001516	000634 				BR	CO1		;DONE WITH GSDS

    515

    516	001520				20$:				;GSD - PSECT DEF

    517	001520	062701 	000010 			ADD	#P$SNLN-1,R1	;++KM002 MOVE R1 TO PSECT NAME LENGTH

    518	001524	000755 				BR	10$		;BR TO SKIP RECORD

    519	001526				30$:				;GSD - REFERENCE .. STRONG OR WEAK

    520	001526	062701 	000004 			ADD	#S$RNLN-1,R1	;++KM002 MOVE R1 TO NAME LENGTH

    521	001532	000752 				BR	10$		;BR TO SKIP RECORD

    522	001534				40$:				;GSD - WEAK DEFINITION

    523	001534	122716 	000002 			CMPB	#GS$EPM,(SP)	; ++KM003 ENTRY POINT WITH MASK?

    524	001540	001403 				BEQ	45$		; ++KM007 YES, GO ADD IN MASK BYTES

    525	001542	122716 	000003 			CMPB	#GS$ARG,(SP)	; ++KM007 PROCEDURE WITH FORMAL ARG DEF?

    526	001546	001002 				BNE	46$		; ++KM007 NO, DON'T ADD IN ENTRY MASK

    527	001550	062701 	000002 		45$:	ADD	#2,R1		; ++KM003 ADD IN TWO BYTES FOR MASK

    528	001554	062701 	000011 		46$:	ADD	#S$DNLN-1,R1	;++KM002 MOVE R1 TO NAME LENGTH

    529	001560	000737 				BR	10$		;BR IF SKIP RECORD

    530					;

    531					; THIS ROUTINE HANDLES THE TIR RECORDS

    532					;

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 5-2





    533	001562				TIR:

    534	001562	000612 				BR	CO1		;IGNORE TIR RECORDS

    535					;

    536					; THIS ROUTINE HANDLES THE END OF MODULE RECORD

    537					;

    538	001564				EOM:

    539	001564	005267 	176252 			INC	ENDFLG		;INDICATE END OF MODULE

    540	001570	105761 	000001 			TSTB	E$OMER(R1)	;+++KM004 IS THE SEVERITY LEVEL >0?

    541	001574	001607 				BEQ	COXIT		;+++KM004 NO, MODULE IS FINE

    542	001576	010046 				MOV	R0,-(SP)	;+++KM004 YES, MODULE HAS ERRORS

    543	001600	010146 				MOV	R1,-(SP)	;+++KM004  MUST OUTPUT A

    544	001602	010246 				MOV	R2,-(SP)	;+++KM004 WARNING MESSAGE

    545	001604	012702 	000052'			MOV	#VBLOCK+6,R2	;+++KM004 GET ARGUMENT BLOCK

    546	001610	012742 	000053'			MOV	#MODNAM+1,-(R2)	;+++KM004 GET ADDRESS OF MODULE NAME

    547	001614	105042 				CLRB	-(R2)		;+++KM004 CLEAR HIGH BYTE OF COUNT

    548	001616	116742 	000052'			MOVB	MODNAM,-(R2)	;+++KM004 GET LENGTH OF MODULE NAME

    549	001622	010142 				MOV	R1,-(R2)	;+++KM004 GET ADDRESS OF EOM RECORD

    550	001624	062712 	000001 			ADD	#E$OMER,(R2)	;+++KM004 ADD OFFSET TO SEVERITY LEVEL

    551	001630	012701 				MOV	(PC)+,R1	;+++KM004 GET MESSAGE SEVERITY CODE

    552	001632	   000G	   000G			.BYTE	E$R77,S$V0	;+++KM006 AND MESSAGE NUMBER

    553	001634					CALL	$ERMSG		;+++KM004 OUTPUT WARNING MESSAGE

    554	001640	012602 				MOV	(SP)+,R2	;+++KM004 RESTORE THE REGISTERS

    555	001642	012601 				MOV	(SP)+,R1	;+++KM004 USED FOR THE MESSAGE OUTPUT

    556	001644	012600 				MOV	(SP)+,R0	;+++KM004 BY THE ERROR ROUTINE

    557	001646	000167 	177342 			JMP	COXIT		;+++KM007 EXIT

    558					;

    559					; THIS ROUTINE HANDLES THE DEBUG RECORDS

    560					;

    561	001652				DBG:

    562	001652	000167 	177332 			JMP	CO1		;++KM007 IGNORE DEBUG RECORDS

    563					;

    564					; THIS ROUTINE HANDLES THE LNK RECORDS

    565					;

    566	001656				LNK:

    567	001656	000167 	177326 			JMP	CO1		;++KM007 IGNORE LINKER RECORDS

    568					;

    569					; ERROR CALL - INVALID RECORD TYPE FOUND IN OBJECT FILE

    570					;

    571	001662				ERROR1:

    572	001662	010002 				MOV	R0,R2		;ADDR OF INPUT FDB IN R2

    573	001664	062702 	000110 			ADD	#F.FNB+N.FNAM,R2;POINT R2 AT FILE NAME

    574	001670	012701 				MOV	(PC)+,R1	;GET ERROR MSG AND CODE

    575	001672	   000G	   000G			.BYTE	E$R30,S$V2

    576	001674	000167 	000000G			JMP	$ERMSG		;GO TO THE ERROR ROUTINE

    577					;+

    578					;

    579					; THIS ROUTINE SCANS FOR FIRST LEVEL MACRO DEFINITIONS IN THE INPUT FILE.

    580					; IT CREATES THE MNT ENTRY FOR EACH DEFINITION IT FINDS AND ONLY SWITCHES

    581					; TO THE MAIN PROGRAM LOOP WHEN IT IS SCANNING LINES OF A MACRO DEFINITION

    582					; WHICH MUST BE WRITTEN TO THE LIBRARY FILE.  THEREFORE IT MUST DO ITS OWN

    583					; INPUT WHILE IT SCANNING OUTSIDE OF A MACRO DEFINITION.

    584					;

    585					;+++STAR  THIS ROUTINE WAS MODIFIED FOR STAR SOFTWARE

    586					;-

    587	001700	012767 	000000G	176072 	INMAC:	MOV	#HS$MAC,MHSZ	;SET MODULE HEADER SIZE

    588	001706				COXIT1:	CALL	@(SP)+		;SWITCH TO MAIN PROGRAM LOOP

    589	001710	005767 	176130 			TST	MDEPTH		;ARE WE INSIDE A MACRO DEFINITION ALREADY?

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 5-3





    590	001714	101077 				BHI	70$		;BRANCH IF SO

    591	001716	005067 	176120 			CLR	ENDFLG		;OTHERWISE INDICATE NO END OF MODULE

    592	001722				10$:	CALL	SCAN		;SCAN FOR NEXT KEY WORD

    593	001726	103402 				BCS	20$		;IF NONE FOUND READ NEW LINE

    594	001730	005704 				TST	R4		;IS KEY WORD ".MACRO"?

    595	001732	001407 				BEQ	30$		;BRANCH IF SO

    596	001734	105060 	000001 		20$:	CLRB	F.RATT(R0)	;++KM001 CAN CROSS BLOCK BOUNDRIES

    597

    598

    604

    605	001740					GET$S	R0		;READ NEXT LINE

    606

    608

    609	001744	103366 				BCC	10$		;BRANCH TO SCAN LINE IF NO ERRORS

    610	001746	000167 	177176 			JMP	CLOSIN		;JUMP TO CLOSE INPUT FILE

    611									;(COROUTINE WILL BE RESTARTED)

    612	001752	010304 			30$:	MOV	R3,R4		;COPY END OF LINE POINTER

    613	001754	160104 				SUB	R1,R4		;MACRO DEF FOUND, CALCULATE CHARS LEFT

    614									;... IN CURRENT LINE

    615	001756	003766 				BLE	20$		;IGNORE LINE IF NO MACRO NAME

    616	001760	022704 	000017 			CMP	#S$MXLN,R4	;+++STAR MORE THAN MAX CHAR ALLOWED

    617	001764	002002 				BGE	40$		;+++STAR BR IF NO

    618	001766	012704 	000017 			MOV	#S$MXLN,R4	;+++STAR TRUNCATE TO MAX CHARS

    619	001772				40$:

    620	001772	012700 	000047'			MOV	#MACNAM+1,R0	;+++STAR GET ADDR OF WHERE TO PUT NAME

    621	001776				50$:

    622	001776	122711 	000101 			CMPB	#'A,(R1)	;+++STAR COULD CHAR BE ALPHA

    623	002002	003003 				BGT	52$		;+++STAR BR IF NO

    624	002004	122711 	000132 			CMPB	#'Z,(R1)	;+++STAR IS IT REALLY ALPHA

    625	002010	002017 				BGE	58$		;+++STAR BR IF YES - SAVE IT

    626	002012				52$:

    627	002012	122711 	000060 			CMPB	#'0,(R1)	;+++STAR COULD IT BE NUMERIC

    628	002016	003003 				BGT	55$		;+++STAR BR IF NO

    629	002020	122711 	000071 			CMPB	#'9,(R1)	;+++STAR IS IT REALLY NUMBERIC

    630	002024	002011 				BGE	58$		;+++STAR BR IF YES - SAVE IT

    631	002026				55$:

    632	002026	122711 	000137 			CMPB	#'_,(R1)	;+++STAR IS IT A '_'

    633	002032	001406 				BEQ	58$		;+++STAR BR IF YES - SAVE IT

    634	002034	122711 	000044 			CMPB	#'$,(R1)	;+++STAR IS IT A '$'

    635	002040	001403 				BEQ	58$		;+++STAR BR IF YES - SAVE IT

    636	002042	122711 	000056 			CMPB	#'.,(R1)	;+++STAR IS IT A '.'

    637	002046	001003 				BNE	60$		;+++STAR BR IF NO - DONE WITH MACRO NAME

    638	002050				58$:

    639	002050	112120 				MOVB	(R1)+,(R0)+	;+++STAR MOVE CHAR

    640	002052					SOB	R4,50$		;+++STAR LOOK TIL DONE

    641	002056				60$:

    642	002056	162700 	000047'			SUB	#MACNAM+1,R0	;+++STAR GET NAME LENGTH

    643	002062	110067 	175760 			MOVB	R0,MACNAM	;+++STAR PUT IT IN NAME

    644	002066	012701 	000046'			MOV	#MACNAM,R1	;+++STAR ADDR OF NAME

    645	002072	012702 	000000G			MOV	#$MNBLK,R2	;+++STAR ADDR OF MNT BLOCK

    646	002076	012704 	000000G			MOV	#L$MA,R4	;+++STAR MODULE HEADER SIZE

    647	002102					CALL	PUT		;+++STAR WRITE MNT ENTRY

    648	002106	005267 	175732 			INC	MDEPTH		;WE ARE IN A MACRO DEF NOW

    649	002112	000417 				BR	SQZ		;BRANCH TO HAVE LINE WRITTEN TO LIB FILE

    650	002114				70$:	CALL	SCAN		;SCAN FOR KEY WORD

    651	002120	103414 				BCS	SQZ		;WRITE LINE IF NONE FOUND

    652	002122	032704 	000004 			BIT	#4,R4		;.MACRO, .REPT, .IRPC OR .IRP?

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 5-4





    653	002126	001003 				BNE	80$		;BRANCH IF NOT

    654	002130	005267 	175710 			INC	MDEPTH		;OTHERWISE INC MACRO DEPTH

    655	002134	000406 				BR	SQZ		;AND WRITE LINE

    656	002136	005367 	175702 		80$:	DEC	MDEPTH		;MUST HAVE BEEN ".ENDM" OR ".ENDR"

    657	002142	001003 				BNE	SQZ		;WRITE LINE IF STILL IN MACRO DEF

    658	002144	005267 	175672 			INC	ENDFLG		;OTHER INDICATE END OF MACRO DEF

    659	002150	000400 				BR	SQZ		;WRITE LAST LINE AND ADJUST POINTERS

    660	002152	032767 	000000G	000000C	SQZ:	BIT	#SZ$SW,R$SWTH+INPPT ;SQUEEZE DESIRED?

    661	002160	001652 				BEQ	COXIT1		;IF EQ NO

    662	002162	016701 	000024G			MOV	F.NRBD+INPPT,R1	;PICK UP CHARACTER COUNT FOR LINE

    663	002166					CALL	ELIM		;ELIMINATE TRAILING BLANKS AND TABS

    664	002172	010167 	000024G			MOV	R1,F.NRBD+INPPT	;UPDATE CHARACTER COUNT

    665	002176	001643 				BEQ	COXIT1		;IF EQ LINE ELIMINATED

    666	002200	124327 	000073 		10$:	CMPB	-(R3),#';	;SEMI-COLON?

    667	002204	001403 				BEQ	20$		;IF EQ YES

    668	002206	005301 				DEC	R1		;OTHERWISE DECREMENT COUNT

    669	002210	001373 				BNE	10$		;IF NE MORE CHARACTERS ON LINE

    670	002212	000635 				BR	COXIT1		;OTHERWISE NO SEMI ON LINE

    671	002214	005301 			20$:	DEC	R1		;DEC COUNT FOR SEMI

    672	002216	001402 				BEQ	30$		;IF EQ FIRST CHAR ON LINE

    673	002220					CALL	ELIM		;ELIMINATE TRAILING BLANKS AND TABS

    674	002224	010167 	000024G		30$:	MOV	R1,F.NRBD+INPPT	;UPDATE CHARACTER COUNT

    675	002230	000626 				BR	COXIT1		;BR TO PRINT LINE

    676

    677

    678					;+

    679					;

    680					; THIS THE SCAN ROUTINE.  IT SCANS FOR KEY WORDS IN THE INPUT SOURCE FILES.

    681					;

    682					; INPUTS:

    683					;	R0 POINTS TO FDB ON WHICH LINE HAS JUST BEEN READ.

    684					;

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 6





    686					; OUTPUTS:

    687					;	C-BIT SET IF NO KEY WORD WAS FOUND ON CURRENT LINE.

    688					;

    689					;	C-BIT CLEAR IF A KEY WORD WAS FOUND, AND

    690					;	R1 POINTS TO FIRST CHARACTER OF OPERAND FIELD (OR PAST END OF LINE)

    691					;	R4 CONTAINS:

    692					;		0 IF IT WAS ".MACRO"

    693					;		1 IF IT WAS ".REPT"

    694					;		2 IF IT WAS ".ENDM"

    695					;		3 IF IT WAS ".ENDR"

    696					;

    697					;-

    698	002232	016001 	000026 		SCAN:	MOV	F.NRBD+2(R0),R1	;POINT TO LINE

    699	002236	016003 	000024 			MOV	F.NRBD(R0),R3	;PICK UP CHARACTER COUNT

    700	002242	060103 				ADD	R1,R3		;POINT TO CHAR PAST END OF LINE

    701	002244	052702 	000001 		5$:	BIS	#1,R2		;INITIALLY INDICATE NO KEY WORD ON LINE

    702	002250					CALL	SKIP		;POINT R1 TO FIRST NON BLANK

    703	002254	103437 				BCS	25$		;BRANCH IF NOTHING ON LINE

    704	002256	121127 	000056 			CMPB	(R1),#'.	;FIRST CHAR "." (POSSIBLE KEY WORD)?

    705	002262	001012 				BNE	10$		;BRANCH IF NOT

    706	002264	005201 				INC	R1		;OTHERWISE POINT TO NEXT CHARACTER

    707	002266	004567 	000064 			JSR	R5,CMPSTR	;SEE IF KEY WORD

    708	002272	000006 				.WORD	6

    709	002274	000122'				.WORD	MACSTR

    710	002276	000130'				.WORD	REPSTR

    711	002300	000135'				.WORD	IRCSTR

    712	002302	000142'				.WORD	IRSTR

    713	002304	000146'				.WORD	ENMSTR

    714	002306	000153'				.WORD	ENRSTR

    715	002310	010105 			10$:	MOV	R1,R5		;SAVE CURRENT STRING POINTER

    716	002312					CALL	SKIP		;POINT TO NEXT NONBLANK

    717	002316	103415 				BCS	20$		;BRANCH ON LINE TERMINATION

    718	002320	122127 	000072 		15$:	CMPB	(R1)+,#':	;RESTART LINE SCAN FOR LABLE

    719	002324	001747 				BEQ	5$		;BRANCH IF SO

    720	002326	124127 	000075 			CMPB	-(R1),#'=	;CHECK FOR ASSIGNMENT STATEMENT

    721	002332	000261 				SEC			;PREPARE TO RETURN STATUS OF NO KEY WORD

    722	002334	001407 				BEQ	25$		;RETURN IF ASSIGNMENT

    723	002336	020105 				CMP	R1,R5		;SEE IF POINTER WAS BUMPED IN "SKIP"

    724	002340	001004 				BNE	20$		;IF IT WAS, THEN OPERATOR HAS BEEN SCANNED

    725	002342	052702 	000001 			BIS	#1,R2		;COULD NOT HAVE SCANNED KEY WORD

    726	002346	005201 				INC	R1		;OTHERWISE BUMP POINTER

    727	002350	000757 				BR	10$		;CONTINUE SCAN

    728	002352	006002 			20$:	ROR	R2		;SET RETURN STATUS

    729	002354				25$:	RETURN

    730

    731

    732					;+

    733					;

    734					; THIS ROUTINE COMPARES A STRING IN THE INPUT BUFFER WITH A SET OF

    735					; STRINGS POINTED TO IN THE CALL.

    736					;

    737					; IT IS CALLED BY:

    738					;	JSR	R5,CMPSTR

    739					;	.WORD	COUNT

    740					;	.WORD	STRPT0

    741					;	.WORD	STRPT1

    742					;	...

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 6-1





    743					;

    744					; WHERE:

    745					;	COUNT IS THE NUMBER OF STRING POINTERS BEING PASSED

    746					;	STRPT0,STRPT1,... ARE POINTERS TO ASCIZ STRINGS

    747					;	R1 POINTS TO THE TEST STRING

    748					;

    749					; OUTPUTS:

    750					;	R2 UNCHANGED IF NO MATCH WAS FOUND

    751					;

    752					;	R2 CLEAR IF MATCH WAS FOUND, AND

    753					;	R1 POINTS TO FIRST CHARACTER OF OPERAND FIELD (OR PAST END OF LINE)

    754					;	R4 CONTAINS NUMBER OF STRING POINTER THAT WAS MATCHED.

    755					;

    756					;-

    757	002356	012504 			CMPSTR:	MOV	(R5)+,R4	;PICK UP COUNT

    758	002360	010446 				MOV	R4,-(SP)	;AND SAVE IT

    759	002362	010146 				MOV	R1,-(SP)	;SAVE STRING POINTER

    760	002364	011601 			5$:	MOV	(SP),R1		;PICK UP INPUT STRING PTR

    761	002366	012502 				MOV	(R5)+,R2	;PICK COMPARE STRING PTR

    762	002370	105712 			10$:	TSTB	(R2)		;AT END OF COMPARE STRING?

    763	002372	001407 				BEQ	15$		;MATCH IF SO

    764	002374	122122 				CMPB	(R1)+,(R2)+	;OTHERWISE, COMPARE NEXT CHARACTER

    765	002376	001774 				BEQ	10$		;LOOP IF EQUAL

    766	002400					SOB	R4,5$		;LOOP UNTIL STRING POINTERS EXHAUSTED

    767	002404	012601 				MOV	(SP)+,R1	;RESTORE INPUT STRING POINTER

    768	002406	005726 				TST	(SP)+		;POP SAVED COUNT

    769	002410	000407 				BR	25$		;BRANCH TO EXIT

    770	002412	005726 			15$:	TST	(SP)+		;THROW AWAY SAVED STRING POINTER

    771	002414	060405 				ADD	R4,R5		;BUMP R5 PAST

    772	002416	060405 				ADD	R4,R5		;...LAST STRING POINTER

    773	002420	005745 				TST	-(R5)		;...AND POINT TO INSTRUCTION AFTER CALL

    774	002422	162604 				SUB	(SP)+,R4	;CALCULATE NEGATIVE OF NUMBER OF MATCH

    775	002424	005404 				NEG	R4		;MAKE POSITIVE

    776	002426	005002 				CLR	R2		;INDICATE SUCCESSFUL MATCH

    777	002430	000205 			25$:	RTS	R5

    778					;+

    779					;

    780					; THIS ROUTINE ATTEMPTS TO POINT R1 TO THE NEXT NONBLANK IN THE CURRENT.

    781					; IT RETURNS:

    782					;

    783					;	C-BIT CLEAR IF SUCCESSFUL

    784					;

    785					;	C-BIT SET IF ";" OR END OF LINE SEEN

    786					;

    787					;-

    788	002432	020103 			SKIP:	CMP	R1,R3		;END OF LINE?

    789	002434	103014 				BHIS	15$		;BRANCH TO RETURN C-BIT SET IF SO

    790	002436	121127 	000073 			CMPB	(R1),#';	;COMMENT FIELD?

    791	002442	001411 				BEQ	15$		;BRANCH IF SO

    792	002444	122127 	000011 			CMPB	(R1)+,#11	;CURRENT CHARACTER A TAB?

    793	002450	001770 				BEQ	SKIP		;BRANCH TO BUMP POINTER IF SO

    794	002452	124127 	000040 			CMPB	-(R1),#40	;CURRENT CHARACTER SPACE?

    795	002456	000241 				CLC			;PREPARE TO RETURN C-BIT CLEAR IF NOT

    796	002460	001003 				BNE	20$		;BRANCH TO RETURN C-BIT CLEAR

    797	002462	005201 				INC	R1		;BUMP POINTER PAST SPACE OR TAB

    798	002464	000762 				BR	SKIP		;CHECK NEXT CHAR

    799	002466	000261 			15$:	SEC

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 6-2





    800	002470				20$:	RETURN

    801

    802

    803					;+

    804					;

    805					; THIS ROUTINE IS USED TO ELIMINATE TRAILING BLANKS AND TABS FROM THE

    806					; CURRENT SOURCE LINE.

    807					;

    808					; INPUTS:

    809					;	R1 CONTAINS CHARACTER OF CURRENT LINE

    810					;	R3 POINTS PAST LAST CHARACTER ON CURRENT LINE

    811					;

    812					; OUTPUTS:

    813					;	R1 CONTAINS UPDATED CHARACTER COUNT

    814					;	R3 POINTS PAST LAST NONBLANK, NONTAB CHARACTER ON LINE

    815					;

    816					;-

    817

    818	002472	005701 			ELIM:	TST	R1		;++KM001 IS LINE BLANK?

    819	002474	001411 				BEQ	30$		;++KM001 YES, RETURN

    820	002476	124327 	000011 			CMPB	-(R3),#11	;CURRENT LAST CHAR A TAB?

    821	002502	001403 				BEQ	10$		;IF EQ YES

    822	002504	121327 	000040 			CMPB	(R3),#40	;CURRENT LAST CHAR A BLANK?

    823	002510	001002 				BNE	20$		;IF NE NO

    824	002512	005301 			10$:	DEC	R1		;REDUCE COUNT FOR TRAILING CHAR

    825	002514	001366 				BNE	ELIM		;IF NE MORE CHARS ON LINE

    826	002516	005203 			20$:	INC	R3		;POINT R3 PAST CURRENT END OF LINE

    827	002520				30$:	RETURN

    828		000001 				.END

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 6-3

SYMBOL TABLE



CH.AND= 000001   	FA.RWD= 004000   	F.EOBB= 000032   	IE.BDV= 177711   	IE.RCN= 177722

CLOSIN  001150R  	FA.SEQ= 040000   	F.ERR = 000052   	IE.BHD= 177700   	IE.RER= 177740

CMPSTR  002356R  	FA.SHR= 000040   	F.FACC= 000043   	IE.BLB= 177672   	IE.RNM= 177715

COXIT   001214R  	FA.TMP= 000020   	F.FFBY= 000014   	IE.BLK= 177754   	IE.RSU= 177757

COXIT1  001706R  	FA.WCK= 020000   	F.FNAM= 000110   	IE.BNM= 177712   	IE.SNC= 177735

CO1     001210R  	FA.WRT= 000002   	F.FNB = 000102   	IE.BTF= 177664   	IE.SPC= 177772

CS.DIF= 000002   	FD.BLK= 000010   	F.FTYP= 000116   	IE.BTP= 177725   	IE.SQC= 177734

CS.DVF= 000004   	FD.CCL= 000002   	F.FVER= 000120   	IE.BVR= 177701   	IE.SRE= 177762

CS.EQU= 000040   	FD.COM= 020000   	F.HIBK= 000004   	IE.BYT= 177755   	IE.STK= 177706

CS.INP= 000001   	FD.CR = 000002   	F.LUN = 000042   	IE.CKS= 177742   	IE.TMM= 177671

CS.MOR= 000020   	FD.DIR= 000010   	F.MBCT= 000054   	IE.CLO= 177732   	IE.TMO= 177666

CS.NMF= 000001   	FD.FTN= 000001   	F.MBC1= 000055   	IE.CNR= 177667   	IE.ULK= 177653

CS.OUT= 000002   	FD.F11= 040000   	F.MBFG= 000056   	IE.CON= 177752   	IE.VER= 177774

CS.WLD= 000010   	FD.INS= 000010   	F.NRBD= 000024   	IE.DAA= 177770   	IE.WAC= 177743

CTLGRP= 000120   	FD.ISP= 002000   	F.NREC= 000030   	IE.DAO= 177763   	IE.WAT= 177741

C.CMLD= 000002   	FD.MNT= 100000   	F.OVBS= 000030   	IE.DFU= 177750   	IE.WCK= 177652

C.DEVD= 000006   	FD.OSP= 004000   	F.RACC= 000016   	IE.DNA= 177771   	IE.WER= 177737

C.DIRD= 000012   	FD.PLC= 000004   	F.RATT= 000001   	IE.DNR= 177775   	IE.WLK= 177764

C.DSDS= 000006   	FD.PRN= 000004   	F.RCNM= 000034   	IE.DUN= 177767   	IE.2DV= 177720

C.FILD= 000016   	FD.PSE= 010000   	F.RCTL= 000017   	IE.DUP= 177707   	INMAC   001700R

C.MKW1= 000024   	FD.RAH= 000001   	F.RSIZ= 000002   	IE.EOF= 177766   	INOBJ   001202R

C.MKW2= 000026   	FD.RAN= 000002   	F.RTYP= 000000   	IE.EOT= 177702   	INPNAM= ****** GX

C.SIZE= 000054   	FD.REC= 000001   	F.SEQN= 000100   	IE.EOV= 177765   	INPPT = ****** GX

C.STAT= 000001   	FD.RWM= 000001   	F.SPDV= 000072   	IE.EXP= 177665   	INSUB   000160R

C.SWAD= 000022   	FD.SDI= 000020   	F.SPUN= 000074   	IE.FEX= 177717   	IN10    000206R

C.TYPR= 000000   	FD.SQD= 000040   	F.STBK= 000036   	IE.FHE= 177705   	IN20    000350R

DATE    000002R  	FD.TTY= 000004   	F.UNIT= 000136   	IE.FLN= 177657   	IRCSTR  000135R

DBG     001652R  	FD.WBH= 000002   	F.URBD= 000020   	IE.FOP= 177713   	IRSTR   000142R

ELIM    002472R  	FF.CHR= 000005   	F.VBN = 000064   	IE.HFU= 177744   	IS.BV = 000005

ENDFLG= 000042R  	FF.NV = 000003   	F.VBSZ= 000060   	IE.IES= 177656   	IS.CC = 001401

ENMSTR  000146R  	FF.POE= 000002   	GSD     001354R  	IE.IFC= 177776   	IS.CR = 006401

ENRSTR  000153R  	FF.RWD= 000001   	GSD1    001356R  	IE.IFU= 177747   	IS.EOT= 002001

EOM     001564R  	FF.RWF= 000006   	GS$ARG= 000003   	IE.ILL= 177726   	IS.ESC= 015401

EOM$MX= 000007   	FF.SPC= 000004   	GS$EPM= 000002   	IE.ISQ= 177703   	IS.ESQ= 115401

EPTERR= ****** GX	FO.APD= 000106   	GS$PSC= 000000   	IE.LCK= 177745   	IS.PES= 100001

EP$SW = ****** GX	FO.MFY= 000002   	GS$SYM= 000001   	IE.MOD= 177753   	IS.PND= 000000

ERROR   000340R  	FO.RD = 000001   	G$SDTY  000001      005	IE.NBF= 177731   	IS.RDD= 000002

ERROR1  001662R  	FO.UPD= 000006   	G.TICP= 000016   	IE.NBK= 177727   	IS.SUC= 000001

ERRXIT  000344R  	FO.WRT= 000016   	G.TICT= 000014   	IE.NDR= 177670   	IS.TAB= 004401

E$OMAD  000003      012	F.ACTL= 000076   	G.TIDA= 000004   	IE.NFI= 177704   	IS.TMO= 000002

E$OMER  000001      012	F.ALOC= 000040   	G.TIHR= 000006   	IE.NFW= 177673   	JMPTBL  001166R

E$OMPS  000002      012	F.BBFS= 000062   	G.TIMI= 000010   	IE.NLK= 177661   	LASTEP  000024RG    013

E$R01 = ****** GX	F.BDB = 000070   	G.TIMO= 000002   	IE.NLN= 177733   	LNK     001656R

E$R02 = ****** GX	F.BGBC= 000057   	G.TISC= 000012   	IE.NNC= 177663   	L$DAT = ****** GX

E$R11 = ****** GX	F.BKDN= 000026   	G.TIYR= 000000   	IE.NNL= 177662   	L$EA  = ****** GX

E$R14 = ****** GX	F.BKDS= 000020   	HS$MAC= ****** GX	IE.NNN= 177674   	L$MA  = ****** GX

E$R30 = ****** GX	F.BKEF= 000050   	HS$OBJ= ****** GX	IE.NOD= 177751   	L$NX  = ****** GX

E$R77 = ****** GX	F.BKP1= 000051   	ID    = 000022R  	IE.NSF= 177746   	L$TYP = ****** GX

FA.APD= 000100   	F.BKST= 000024   	IE.ABO= 177761   	IE.NST= 177660   	MACNAM  000046R

FA.CRE= 000010   	F.BKVB= 000064   	IE.ALC= 177654   	IE.OFL= 177677   	MACSTR  000122R

FA.DLK= 001000   	F.CHR = 000075   	IE.ALN= 177736   	IE.ONP= 177773   	MAXALI= 000011

FA.ENB= 100000   	F.CNTG= 000034   	IE.AST= 177660   	IE.OVR= 177756   	MDEPTH  000044R

FA.EXC= 002000   	F.DFNB= 000046   	IE.BAD= 177777   	IE.PES= 177655   	MHD     001266R

FA.EXT= 000004   	F.DSPT= 000044   	IE.BBE= 177710   	IE.PRI= 177760   	MHD$MX= 000111

FA.NSP= 000100   	F.DVNM= 000134   	IE.BCC= 177676   	IE.RAC= 177724   	MHSIZE= ****** GX

FA.POS= 010000   	F.EFBK= 000010   	IE.BDI= 177714   	IE.RAT= 177723   	MHSZ    000000R

FA.RD = 000001   	F.EFN = 000050   	IE.BDR= 177716   	IE.RBG= 177730   	MH$CPY= 000004

LIBIN	MACRO M1110  22-AUG-78 02:12  PAGE 6-4

SYMBOL TABLE



MH$GTX= 000006   	N.UNIT= 000034   	RPBLK   000000R     013	S$MXLN= 000017   	$EPBLK= ****** GX

MH$LNM= 000001   	OBJ$SL= 000000   	RPM     000070R  	S$RNAM  000006      010	$ERMSG= ****** GX

MH$MHD= 000000   	OB$DBG= 000004   	RPMHD = 000020RG    013	S$RNLN  000005      010	$INPPT= ****** GX

MH$MTC= 000005   	OB$EOM= 000003   	RPMNT = 000000RG    013	S$SDTY  000002      007	$INS    000170RG

MH$SRC= 000002   	OB$GSD= 000001   	RPSIZ = 000024   	S$SFL0  000003      007	$LIBPT= ****** GX

MH$TTL= 000003   	OB$HDR= 000000   	RP$SW = ****** GX	S$SFL1  000004      007	$MHBUF= ****** GX

MODNAM  000052R     013	OB$LNK= 000005   	R$MXLN= 001000   	S$V0  = ****** GX	$MHST = ****** GX

MTC$MX= 000213   	OB$TIR= 000002   	R$NAME= ****** GX	S$V2  = ****** GX	$MNBLK= ****** GX

M$HDMS  000003      003	OPRGRP= 000062   	R$SWTH= ****** GX	S$$LIB= 000000   	$OPEN = ****** GX

M$HDNM  000005      003	O$BJTY  000000      002	R$$11M= 000000   	S.FATT= 000016   	$OPNFL= ****** GX

M$HDSL  000002      003	PAGALI= 000011   	R.FIX = 000001   	S.FDB = 000140   	$OUT  = ****** GX

M$HDST  000001      003	PAR$$$= 000000   	R.SEQ = 000003   	S.FNAM= 000006   	$OUT1 = ****** GX

M$TCPN  000002      004	PF$GBL= 000020   	R.VAR = 000002   	S.FNB = 000036   	$RDHD = ****** GX

NB.DEV= 000200   	PF$OVL= 000004   	SCAN    002232R  	S.FNBW= 000017   	$SAVRG= ****** GX

NB.DIR= 000100   	PF$PIC= 000001   	SDF$MX= 000032   	S.FNTY= 000004   	$SCANI= ****** GX

NB.NAM= 000004   	PF$RD = 000200   	SF$DEF= 000002   	S.FTYP= 000002   	$SWTCH= ****** GX

NB.SD1= 000400   	PF$REL= 000010   	SF$REL= 000010   	S.NFEN= 000020   	$WTHD = ****** GX

NB.SD2= 001000   	PF$SHR= 000040   	SF$UNI= 000004   	TIR     001562R  	$$    = 000001

NB.SNM= 000040   	PF$UNI= 000002   	SF$VAL= 000020   	TIRMAX= 000121   	$$MSG = 000000

NB.STP= 000020   	PF$WRT= 000001   	SF$WK = 000001   	T$CHAR= 000005   	$$S   = 000005

NB.SVR= 000010   	PF$XEQ= 000100   	SKIP    002432R  	T$HEAD= 000000   	$$$OST= 000020

NB.TYP= 000002   	PSD$MX= 000031   	SQZ     002152R  	T$SLEN= 000004   	$$0   = 000002

NB.VER= 000001   	PUT   = ****** GX	SRF$MX= 000025   	T$SMBL= 000004   	$$1   = 000002

N.DID = 000024   	P$SALI  000002      006	SS$SW = ****** GX	VBLOCK  000044R     013	.CLOSE= ****** G

N.DVNM= 000032   	P$SALO  000005      006	STAGRP= 000000   	V$MEML= 000002   	.GETSQ= ****** G

N.FID = 000000   	P$SFL0  000003      006	STOGRP= 000024   	XXX     000022R  	.MARK = ****** GX

N.FNAM= 000006   	P$SFL1  000004      006	SZ$SW = ****** GX	XXXSIZ= 000022   	.POINT= ****** GX

N.FTYP= 000014   	P$SNAM  000012      006	S$DNAM  000013      011	$     = 000000      012	.PUT  = ****** G

N.FVER= 000016   	P$SNLN  000011      006	S$DNLN  000012      011	$CLEAR= ****** GX	...GBL= 000000

N.NEXT= 000022   	Q$$CMO= 000000   	S$DPSI  000005      011	$CSIBK= ****** GX	...TPC= 000140

N.STAT= 000020   	REPSTR  000130R  	S$DVAL  000006      011	$DELM = ****** GX



. ABS.	000000	   000

      	002522	   001

OBJREC	000001	   002

MHDREC	000111	   003

MTCREC	000213	   004

GSDREC	000002	   005

PSDEF 	000031	   006

SYMBOL	000005	   007

SYMREF	000025	   010

SYMDEF	000032	   011

EOMREC	000007	   012

PUTCOM	000072	   013

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  4477 WORDS  ( 18 PAGES)

DYNAMIC MEMORY:  5940 WORDS  ( 22 PAGES)

ELAPSED TIME:  00:00:33

OBJ$:LIBIN,LIS$:LIBIN/-SP=SRC$:NEWFORMAT.,LIBPRE,LIBIN

