MACLIB	MACRO M1110  21-AUG-78 22:54

TABLE OF CONTENTS



     8-   47	IMCALL		IMPLIED MACRO CALL ROUTINE

     9-  293	NXTMLB		OPEN NEXT MACRO LIBRARY

    10-  346	CMPMAC		COMPARE MACRO NAMES

    11-  382	MCALL		".MCALL" DIRECTIVE

    12-  421	MLBLIN		COPY LINE FROM MACRO LIBRARY INTO MEMORY

    12-  445	LIBERR		LIBRARY FORMAT ERROR

    13-  459	MSETUP		CHANGE INPUT CONTEXT TO MACRO LIBRARY

    14-  531	MRESTORE	RESTORE INPUT CONTEXT AFTER LIBRARY MACRO DEF

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 1





      1						.IDENT	\X03.11\

      2					;

      3					; COPYRIGHT (C) 1977, 1978

      4					; DIGITAL EQUIPMENT CORPORATION, MAYNARD MASSACHUSETTS 01754

      5					;

      6					; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ON A SINGLE

      7					; COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH THE INCLUSION OF THE

      8					; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

      9					; MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

     10					; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

     11					; TERMS.  TITLE TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES

     12					; REMAIN IN DEC.

     13					;

     14					; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

     15					; AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT

     16					; CORPORATION.

     17					;

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

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

     20					;

     21

     22					;++

     23					; FACILITY:	VAX-11 MACRO OBJECT MODULE LIBRARY "MAR.OLB"

     24					;

     25					; ABSTRACT:	THIS MODULE IS PART OF THE VAX-11 MACRO ASSEMBLER, ITS DESCRIPTION

     26					;		IS ON THE FOLLOWING PAGE.

     27					;

     28					;

     29					; ENVIRNOMENT:	VAX-11 MACRO RUNS ON ANY VAX-11 WITH COMPATIBILITY MODE, UNDER

     30					;		THE CME (COMPATIBILITY MODE EMULATOR) OF VAX/VMS OR ON A PDP-11

     31					;		WITH EXTENDED INSTRUCTIONS UNDER RSX-11/M.

     32					;

     33					; AUTHOR:	STEVE POULSEN, CREATION DATE:  22-JUL-76

     34					;		DALE A. ROEDGER, 10-JAN-77 - 19-DEC-77

     35					;		DAVE N. CUTLER

     36					;		BENN L. SCHREIBER

     37					;

     38					; MODIFIED BY:

     39					;

     40					;--

     41					.IF NDF $DATA$

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 7





      1						.MCALL	CLOSE$,	DIR$,	GET$S,	FDRC$R,	FDAT$R,	OFNB$R,	QIOW$

      2					.TITLE	MACLIB

      3	000000				.PSECT	BUFFER ABS

      4

      5					;+

      6					; DEFINE THE OFFSETS INTO THE LIBRARY HEADER

      7					;-

      8

      9	000000				L$BUF::

     10	000000				L$TYP::	.BLKB	1		;LIBRARY TYPE (OBJ, ETC)

     11	000001				L$ID::	.BLKB	1		;LIBRARY FILE ID

     12	000002				L$VER::	.BLKW	2		;CREATED BY LBR VERSION V-RRRRRR

     13	000006				L$DAT::	.BLKW	6		;DATE OF LAST MODULE INSERTION

     14	000022				L$ES::	.BLKB	1		;SIZE OF LIBRARY EPT ENTRIES

     15	000023					.BLKB	1		;UNUSED BYTE

     16	000024				L$ET::	.BLKW	1		;LOW-ORDER VBN OF START OF EPT IN FILE

     17	000026				L$EI::	.BLKW	1		;NUMBER OF EPT ENTRIES ALLOCATED

     18	000030				L$EA::	.BLKW	1		;NUMBER OF EPT ENTRIES AVAILABLE

     19	000032				L$MS::	.BLKB	1		;SIZE OF LIBRARY MNT ENTRIES

     20	000033					.BLKB	1		;UNUSED BYTE

     21	000034				L$MT::	.BLKW	1		;LOW-ORDER VBN OF START OF MNT IN FILE

     22	000036				L$MI::	.BLKW	1		;NUMBER OF MNT ENTRIES ALLOCATED

     23	000040				L$MA::	.BLKW	1		;NUMBER OF MNT ENTIRES AVAILABLE

     24	000042				L$LD::	.BLKW	2		;LOGICALLY DELETED MODULE SPACE (BYTES)

     25	000046				L$LA::	.BLKW	2		;BYTES AVAILABLE FOR MODULE INSERTS

     26	000052				L$NX::	.BLKW	2		;ADDR (VBN+OFFSET) OF NEXT MODULE INSERT

     27	000056				L$MXLN::.BLKW	1		;+++STAR MAX LENGTH OF SYMBOL IN LIBRARY

     28

     29		000201 			ID$	== 129.			; LIBRARY FILE ID

     30		000001 			TY$MAC	== 1			; DEFINES MACRO DEF MODULE TYPE

     31		000031 			MAXNAM	= 25.			; 25 MACRO NAMES PER INDEX BLOCK

     32		000024 			MNLEN	= 20.			; 20 BYTES PER MACRO NAME IN INDEX BLOCK

     33

     34					;

     35					; LOCAL DATA

     36					;

     37

     38	000000					.PSECT	MACLIB

     39	000000				BLKCUR:	.BLKW	1			;STARTING VBN OF NEXT SEGMENT OF INDEX

     40	000002				BLKMAX:	.BLKW	1			;HIGHEST INDEX VBN PLUS 1

     41	000004				MLBBUF:	.BLKB	200.			;MACRO LIBRARY HEADER RECORD READ BUFFER

     42	000314				MLBMAC:	.BLKW	2			;POINT PARAMETERS FOR CURRENT MACRO

     43	000320				MLBPTR:	.BLKW	1			;POINTER TO CURRENT LIBRARY DESCRIPTOR

     44	000322				MLBQIO:	QIOW$	IO.RVB,7,1,,MLIOSB	;LIBRARY INDEX DIRECTIVE PARAMETER BLOCK

     45	000352				MLIOSB:	.BLKW	2			;MACRO LIBRARY I/O STATUS BLOCK

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 8

IMCALL		IMPLIED MACRO CALL ROUTINE



     47						.SBTTL	IMCALL		IMPLIED MACRO CALL ROUTINE

     48					;++

     49					; THIS ROUTINE IS CALLED EITHER BY "MCALL" OR BY THE "SYMBOL" ROUTINE WHEN

     50					; AN UNDEFINED NAME IS DETECTED.  ALL MACRO LIBRARIES ARE SEARCHED STARTING

     51					; WITH THE LAST ONE SPECIFIED.  THE FOLLOWING METHOD IS USED:

     52					;

     53					;	- FIRST THE INDEX BLOCK WHERE THE NAME IS TO BE FOUND IF IT IS IN

     54					;	THIS MACRO LIBRARY IS FOUND VIA A SEQUENTIAL SEARCH OF THE LAST

     55					;	NAME IN EACH BLOCK.

     56					;

     57					;	- THEN A BINARY SEARCH IS PERFORMED ON THAT INDEX BLOCK.

     58					;

     59					;	- IF THE MACRO NAME IS NOT FOUND THE NEXT MACRO LIBRARY IS OPENED

     60					;	AND THE PROCESS IS REPEATED.

     61					;--

     62

     63	000356				IMCALL::

     64	000356	010546 				MOV	R5,-(SP)		;SAVE REGISTERS

     65	000360	010446 				MOV	R4,-(SP)		;

     66	000362	010346 				MOV	R3,-(SP)		;

     67	000364	012767 	000000G	177726 		MOV	#CURMLB,MLBPTR		;INITIALIZE MACRO LIBRARY POINTER

     68

     69					;

     70					; GET NEXT MACRO LIBRARY PARAMETERS AND INITIALIZE SEARCH VARIABLES

     71					;

     72

     73	000372	017767 	177722 	177720 	10$:	MOV	@MLBPTR,MLBPTR		;GET ADDRESS OF NEXT LIBRARY ID BLOCK

     74	000400	004767 	001006 			JSR	PC,NXTMLB		;OPEN NEXT MACRO LIBRARY FILE

     75	000404	005000 				CLR	R0			;CLEAR HIGH PART OF DIVIDEND

     76	000406	016701 	000000G			MOV	MNCNT,R1		;NUMBER OF MACROS IN LIBRARY

     77	000412	062701 	000030 			ADD	#MAXNAM-1,R1		;ROUND UP TO NEXT BLOCK

     78	000416	071027 	000031 			DIV	#MAXNAM,R0		;CALCULATE NUMBER OF INDEX BLOCKS

     79	000422	016701 	000000G			MOV	BLKVBN,R1		;GET BASE VIRTUAL BLOCK NUMBER OF MNT

     80	000426	010167 	177346 			MOV	R1,BLKCUR		;SET CURRENT VIRTUAL BLOCK NUMBER

     81	000432	010167 	177710 			MOV	R1,MLBQIO+Q.IOPL+10	;SET CURRENT VIRTUAL BLOCK NUMBER

     82	000436	060100 				ADD	R1,R0			;CALCULATE ENDING VIRTUAL BLOCK PLUS 1

     83	000440	010067 	177336 			MOV	R0,BLKMAX		;SAVE HIGHEST VIRTUAL BLOCK NUMBER

     84

     85					;

     86					; CHECK TO SEE IF THE MACRO NAME TABLE FROM THE LAST MACRO DEFINITION IS STILL

     87					; IN MEMORY.

     88					;

     89

     90	000444	016700 	000000G			MOV	MLBBOT,R0		;GET ADDRESS OF READ BUFFER

     91	000450	001423 				BEQ	20$			;IF EQ NONE

     92	000452	010067 	177660 			MOV	R0,MLBQIO+Q.IOPL	;SET ADDRESS OF READ BUFFER

     93	000456	016701 	000000G			MOV	MLBLEN,R1		;GET LENGTH OF READ BUFFER

     94	000462	010002 				MOV	R0,R2			;COPY ADDRESS OF READ BUFFER

     95	000464	162702 	000204 			SUB	#132.,R2		;ALLOW FOR 132. BYTE BUFFER ZONE

     96	000470	020267 	000000G			CMP	R2,FREEPT		;FREE AREA CROSSED INTO BUFFER?

     97	000474	103411 				BLO	20$			;IF LO YES

     98	000476	010103 				MOV	R1,R3			;COPY LENGTH OF READ BUFFER

     99	000500	060003 				ADD	R0,R3			;CALCULATE TOP ADDRESS OF READ BUFFER

    100	000502	062703 	000204 			ADD	#132.,R3		;ALLOW FOR 132. BYTE BUFFER ZONE

    101	000506	020367 	000000G			CMP	R3,FRIEND		;FREE ARE CROSSED INTO BUFFER?

    102	000512	101002 				BHI	20$			;IF HI YES

    103	000514	000167 	000434 			JMP	130$			;

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 8-1

IMCALL		IMPLIED MACRO CALL ROUTINE



    104

    105					;

    106					; CHECK IF TOP LEVEL MACRO NAME TABLE IS BEING SEARCHED AND IF SO THEN ATTEMPT

    107					; TO USE MACRO INDEX BLOCK IF ONE WAS PREVIOUSLY CREATED.

    108					;

    109

    110	000520	026767 	000000G	177572 	20$:	CMP	CURMLB,MLBPTR		;SEARCHING TOP LEVEL LIBRARY?

    111	000526	001027 				BNE	50$			;IF NE NO

    112	000530	016704 	000000G			MOV	MLBIND,R4		;GET ADDRESS OF TOP LEVEL INDEX BLOCK

    113	000534	001424 				BEQ	50$			;IF EQ NONE

    114	000536	010405 				MOV	R4,R5			;COPY ADDRESS OF INDEX BLOCK

    115	000540	062704 	001000 			ADD	#512.,R4		;CALCULATE ENDING ADDRESS OF BLOCK

    116	000544	010501 			30$:	MOV	R5,R1			;SET ADDRESS OF NEXT INDEX MACRO NAME

    117	000546	004767 	001132 			CALL	CMPSYM			;COMPARE MACRO NAMES

    118	000552	101404 				BLOS	40$			;IF LOS NAME POSITION FOUND

    119	000554	062705 	000020 			ADD	#16.,R5			;ADVANCE TO NEXT MACRO NAME

    120	000560	020405 				CMP	R4,R5			;END OF INDEX BLOCK?

    121	000562	001370 				BNE	30$			;IF NE NO

    122	000564	166705 	000000G		40$:	SUB	MLBIND,R5		;CALCULATE BYTE OFFSET IN BLOCK

    123	000570	005004 				CLR	R4			;CLEAR HIGH PART OF DIVIDEND

    124	000572	071427 	000020 			DIV	#16.,R4			;CALCULATE RELATIVE BLOCK NUMBER

    125	000576	066704 	000000G			ADD	BLKVBN,R4		;CALCULATE VIRTUAL BLOCK NUMBER

    126	000602	010467 	177172 			MOV	R4,BLKCUR		;SET CURRENT BLOCK NUMBER

    127

    128					;

    129					; ALLOCATE BUFFER SPACE AND READ MACRO LIBRARY INDEX INTO MEMORY

    130					;

    131

    132	000606	005067 	000000G		50$:	CLR	MLBBOT			;CLEAR ADDRESS OF READ BUFFER

    133	000612	012700 	000000G			MOV	#MACLBF,R0		;GET ADDRESS OF DEFAULT BUFFER

    134	000616	012701 	001000 			MOV	#512.,R1		;SET LENGTH OF FCS BUFFER

    135	000622	016703 	000000G			MOV	FRIEND,R3		;GET ADDRESS OF TOP OF FREE SPACE

    136	000626	166703 	000000G			SUB	FREEPT,R3		;SUBTRACT STARTING ADDRESS OF FREE SPACE

    137	000632	162703 	000204 			SUB	#132.,R3		;ALLOW ROOM FOR CURRENT MACRO NAME

    138	000636	005002 				CLR	R2			;CLEAR HIGH PART OF DIVIDEND

    139	000640	071227 	001000 			DIV	#512.,R2		;CALCULATE NUMBER OF BLOCK BUFFERS

    140	000644	001450 				BEQ	80$			;IF EQ NONE

    141

    142					;

    143					; ADEQUATE SPACE FOR AT LEAST ONE BUFFER IS AVAILABLE IN THE MEMORY ALLOCATION

    144					; POOL. ATTEMPT TO READ IN ENTIRE MACRO LIBRARY NAME TABLE

    145					;

    146

    147	000646	016703 	177130 			MOV	BLKMAX,R3		;CALCULATE TOTAL BLOCKS IN LIBRARY INDEX

    148	000652	166703 	000000G			SUB	BLKVBN,R3		;

    149	000656	020203 				CMP	R2,R3			;BUFFER LARGER THAN ENTIRE INDEX?

    150	000660	103424 				BLO	60$			;IF LO NO

    151	000662	160302 				SUB	R3,R2			;CALCULATE NUMBER OF EXTRA BLOCKS

    152	000664	006202 				ASR	R2			;SPLIT THE DIFFERENCE

    153	000666	000302 				SWAB	R2			;MULTIPLY BE 512. BYTES

    154	000670	006302 				ASL	R2			;

    155	000672	066702 	000000G			ADD	FREEPT,R2		;CALCULATE ADDRESS OF READ BUFFER

    156	000676	010200 				MOV	R2,R0			;COPY ADDRESS OF READ BUFFER

    157	000700	062700 	000204 			ADD	#132.,R0		;ALLOW 132. BYTE BUFFER ZONE

    158	000704	070327 	001000 			MUL	#512.,R3		;CALCULATE NUMBER OF BYTES

    159	000710	010301 				MOV	R3,R1			;COPY NUMBER OF BYTES

    160	000712	010067 	000000G			MOV	R0,MLBBOT		;SET ADDRESS OF READ BUFFER

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 8-2

IMCALL		IMPLIED MACRO CALL ROUTINE



    161	000716	010167 	000000G			MOV	R1,MLBLEN		;SET LENGTH OF READ BYFFER

    162	000722	016767 	000000G	177050 		MOV	BLKVBN,BLKCUR		;RESET TO BEGINNING BLOCK NUMBER

    163	000730	000416 				BR	80$			;

    164

    165					;

    166					; ENTIRE LIBRARY MACRO NAME TABLE CANNOT BE READ INTO MEMORY. READ AS LARGE A

    167					; SEGMENT OF THE NAME TABLE AS POSSIBLE.

    168					;

    169

    170	000732	016703 	177044 		60$:	MOV	BLKMAX,R3		;GET HIGHEST VIRTUAL BLOCK NUMBER

    171	000736	166703 	177036 			SUB	BLKCUR,R3		;CALCULATE REMAINING BLOCKS IN MNT

    172	000742	020203 				CMP	R2,R3			;BUFFER LARGER THAN REMAINING BLOCKS?

    173	000744	002001 				BGE	70$			;IF GE YES

    174	000746	010203 				MOV	R2,R3			;SET NUMBER OF BLOCKS TO SIZE OF BUFFER

    175	000750	070327 	001000 		70$:	MUL	#512.,R3		;CALCULATE NUMBER OF BYTES TO READ

    176	000754	016700 	000000G			MOV	FREEPT,R0		;GET STARTING ADDRESS OF FREE SPACE

    177	000760	062700 	000204 			ADD	#132.,R0		;POINT PAST CURRENT MACRO NAME SYMBOL

    178	000764	010301 				MOV	R3,R1			;SET NUMBER OF BYTES TO READ

    179	000766	022700 	000000G		80$:	CMP	#MACLBF,R0		;READING INTO RESERVED BUFFER?

    180	000772	001002 				BNE	90$			;IF NE NO

    181	000774	005067 	000000G			CLR	MLBIND			;CLEAR MACRO LIBRARY INDEX BLOCK ADDRESS

    182	001000	010067 	177332 		90$:	MOV	R0,MLBQIO+Q.IOPL	;SET STARTING ADDRESS OF READ BUFFER

    183	001004	010167 	177330 			MOV	R1,MLBQIO+Q.IOPL+2	;SET TRANSFER BYTE COUNT

    184	001010	016767 	176764 	177330 		MOV	BLKCUR,MLBQIO+Q.IOPL+10	;SET STARTING VIRTUAL BLOCK NUMBER

    185	001016					DIR$	#MLBQIO			;READ IN NEXT MNT BUFFER

    186	001024	103570 				BCS	230$			;IF CS DIRECTIVE ERROR

    187	001026	105767 	177320 			TSTB	MLIOSB			;ANY I/O ERROR?

    188	001032	002565 				BLT	230$			;IF LT YES

    189	001034	005267 	000000G			INC	GETLIB			;ACCOUNT FOR READ OPERATION

    190

    191					;

    192					; CHECK TO SEE IF ENTIRE MACRO NAME TABLE OF TOP LEVEL LIBRARY WAS READ INTO

    193					; MEMORY. IF IT WAS, THEN CONSTRUCT AN INDEX BLOCK IN THE RESERVED BUFFER.

    194					;

    195

    196	001040	026767 	000000G	177252 		CMP	CURMLB,MLBPTR		;TOP LEVEL MACRO LIBRARY BEING SEARCHED?

    197	001046	001042 				BNE	130$			;IF NE NO

    198	001050	016704 	000000G			MOV	MLBBOT,R4		;GET ADDRESS OF NAME TABLE READ BUFFER

    199	001054	001437 				BEQ	130$			;IF EQ NONE

    200	001056	010405 				MOV	R4,R5			;COPY ADDRESS OF NAME TABLE READ BUFFER

    201	001060	062704 	000744 			ADD	#<<MAXNAM-1>*MNLEN>+4,R4 ;POINT TO LAST MACRO NAME IN BLOCK

    202	001064	066705 	000000G			ADD	MLBLEN,R5		;CALCULATE ENDING ADDRESS OF NAME BUFFER

    203	001070	012702 	000000G			MOV	#MACLBF,R2		;GET ADDRESS OF RESERVED READ BUFFER

    204	001074	010267 	000000G			MOV	R2,MLBIND		;SET ADDRESS OF NAME TABLE INDEX BLOCK

    205	001100	010203 				MOV	R2,R3			;COPY ADDRESS OF RESERVED BUFFER

    206	001102	062703 	001000 			ADD	#512.,R3		;CALCULATE ENDING ADDRESS OF READ BUFFER

    207	001106	012701 	000020 		100$:	MOV	#16.,R1			;SET LOOP COPY COUNT

    208	001112	010400 				MOV	R4,R0			;SET ADDRESS OF NAME TABLE ENTRY

    209	001114	112022 			110$:	MOVB	(R0)+,(R2)+		;MOVE MACRO NAME AND LENGTH TO INDEX

    210	001116	077102 				SOB	R1,110$			;ANY MORE CHARACTERS TO COPY?

    211	001120	020203 				CMP	R2,R3			;END OF INDEX BLOCK?

    212	001122	001414 				BEQ	130$			;IF EQ YES

    213	001124	062704 	001000 			ADD	#512.,R4		;POINT TO LAST MACRO NAME IN NEXT BLOCK

    214	001130	020405 				CMP	R4,R5			;ANY MORE MACRO NAME TABLE BLOCKS?

    215	001132	103765 				BLO	100$			;IF LO YES

    216	001134	012701 	000020 			MOV	#16.,R1			;SET LOOP COPY COUNT

    217	001140	112710 	177777 			MOVB	#-1,(R0)		;SET COPY BYTE

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 8-3

IMCALL		IMPLIED MACRO CALL ROUTINE



    218	001144	111020 			120$:	MOVB	(R0),(R0)+		;INSERT DUMMY LAST MACRO NAME IN INDEX

    219	001146	077102 				SOB	R1,120$			;ANY MORE CHARACTERS TO COPY?

    220	001150	016701 	177164 			MOV	MLBQIO+Q.IOPL+2,R1	;RETREIVE LENGTH OF READ BUFFER

    221

    222					;

    223					; CALCULATE NUMBER OF BLOCKS READ AND SEARCH BLOCKS FOR CORRECT MACRO NAME

    224					;

    225

    226	001154	005000 			130$:	CLR	R0			;CLEAR HIGH PART OF DIVIDEND

    227	001156	071027 	001000 			DIV	#512.,R0		;CALCULATE NUMBER OF BLOCK READ

    228	001162	060067 	176612 			ADD	R0,BLKCUR		;CALCULATE VIRTUAL BLOCK OF NEXT READ

    229	001166	012701 	000030 		140$:	MOV	#MAXNAM-1,R1		;GET INDEX OF LAST NAME IN BLOCK

    230	001172	010105 				MOV	R1,R5			;SAVE INDEX OF LAST NAME IN BLOCK

    231	001174	070127 	000024 			MUL	#MNLEN,R1		;CALCULATE BYTE OFFSET TO LAST NAME

    232	001200	004767 	000464 			CALL	CMPMAC			;COMPARE MACRO NAMES

    233	001204	001452 				BEQ	210$			;IF EQ NAME FOUND

    234	001206	103417 				BLO	150$			;IF LO MUST BE IN BLOCK

    235	001210	062767 	001000 	177120 		ADD	#512.,MLBQIO+Q.IOPL	;ADVANCE BUFFER POINTER TO NEXT BLOCK

    236	001216	005267 	177124 			INC	MLBQIO+Q.IOPL+10	;INCREMENT VIRTUAL BLOCK NUMBER

    237	001222	026767 	176552 	177116 		CMP	BLKCUR,MLBQIO+Q.IOPL+10	;ANY MORE BLOCKS TO SCAN THIS BUFFER?

    238	001230	001356 				BNE	140$			;IF NE YES

    239	001232	026767 	176542 	176542 		CMP	BLKCUR,BLKMAX		;ANY MORE BLOCKS TO SCAN THIS LIBRARY?

    240	001240	001424 				BEQ	190$			;IF EQ NO

    241	001242	000167 	177340 			JMP	50$			;

    242

    243					;

    244					; BINARY SEARCH OF ONE MACRO NAME TABLE BLOCK

    245					;

    246

    247	001246	005004 			150$:	CLR	R4			;ZERO LEFT HAND INDEX

    248	001250	010401 			160$:	MOV	R4,R1			;

    249	001252	060501 				ADD	R5,R1			;ADD LEFT AND RIGHT INDICIES

    250	001254	006201 				ASR	R1			;DIVIDE BY TWO

    251	001256	010146 				MOV	R1,-(SP)		;SAVE MID-POINT INDEX

    252	001260	070127 	000024 			MUL	#MNLEN,R1		;GET BYTE INDEX OF MID MACRO

    253	001264	004767 	000400 			CALL	CMPMAC			;COMPARE MACRO NAMES

    254	001270	001417 				BEQ	200$			;IF EQ NAME FOUND

    255	001272	103403 				BLO	170$			;IF LO NAME IN FIRST HALF OF TABLE

    256

    257					;

    258					; NAME IS IN SECOND HALF OF TABLE

    259					;

    260

    261	001274	012604 				MOV	(SP)+,R4		;UPDATE LEFT HAND POINTER

    262	001276	005204 				INC	R4			;SKIP OVER MID-POINT MACRO

    263	001300	000402 				BR	180$			;

    264

    265					;

    266					; NAME IS IN FIRST HALF OF TABLE

    267					;

    268

    269	001302	012605 			170$:	MOV	(SP)+,R5		;UPDATE RIGHT HAND INDEX

    270	001304	005305 				DEC	R5			;SKIP OVER MID-POINT MACRO

    271	001306	020405 			180$:	CMP	R4,R5			;COMPARE END-POINTS

    272	001310	003757 				BLE	160$			;CONTINUE SEARCHING UNTIL CROSSING

    273	001312	012700 	000000G		190$:	MOV	#ERR03,R0		;ASSUME END OF LIBRARY

    274	001316	005777 	176776 			TST	@MLBPTR			;END OF MACRO LIBRARY CHAIN

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 8-4

IMCALL		IMPLIED MACRO CALL ROUTINE



    275	001322	001425 				BEQ	220$			;IF EQ YES

    276	001324	000167 	177042 			JMP	10$			;

    277	001330	005726 			200$:	TST	(SP)+			;REMOVE MIDPOINT FROM STACK

    278	001332	004767 	000744 		210$:	JSR	PC,MSETUP		;SET UP FOR MACRO LIBRARY READING

    279	001336	004767 	000000G			JSR	PC,MACRO		;DEFINE MACRO

    280	001342	026767 	000000G	000000G		CMP	FREEPT,MLBBOT		;DID MAC DEF OVERFLOW INTO MNT?

    281	001350	103402 				BLO	215$			;IF LO NO

    282	001352	005067 	000000G			CLR	MLBBOT			;YES--CLEAR READ BUFFER ADDRESS

    283	001356	004767 	001276 		215$:	JSR	PC,MRESTORE		;RESTORE ORIGINAL INPUT CONTEXT

    284	001362	012700 	000000G			MOV	#MACTXT,R0		;RETURN "MACRO" TOKEN VALUE

    285	001366	016702 	000000G			MOV	MCNAM,R2		;RETURN ADDRESS OF MACRO NAME BLOCK

    286	001372	005267 	000000G			INC	GETPSC			;COUNT THIS MACRO

    287	001376	012603 			220$:	MOV	(SP)+,R3		;RESTORE REGISTER

    288	001400	012604 				MOV	(SP)+,R4		;

    289	001402	012605 				MOV	(SP)+,R5		;

    290	001404	000207 				RETURN				;

    291	001406	000167 	000654 		230$:	JMP	LIBERR			;LIBRARY I/O ERROR

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 9

NXTMLB		OPEN NEXT MACRO LIBRARY



    293					.SBTTL	NXTMLB		OPEN NEXT MACRO LIBRARY

    294					;++

    295					; THIS ROUTINE OPENS THE NEXT MACRO LIBRARY ON THE LIBRARY STACK.

    296					; IT RETURNS :

    297					;	MNCNT	- THE NUMBER OF MACROS IN THE LIBRARY

    298					;	BLKVBN	- THE BLOCK NUMBER OF THE MACRO NAME TABLE

    299					;	LASTML	- THE ADDRESS OF THE CURRENTLY OPEN FILE ID BLOCK

    300					;--

    301

    302	001412				NXTMLB:

    303	001412	026767 	000000G	176700 		CMP	CURMLB,MLBPTR		;IS THIS A NEW LOOK-UP?

    304	001420	001004 				BNE	10$			;IF NE NO

    305	001422	026767 	000000G	000000G		CMP	CURMLB,LASTML		;IS THERE A NEW "TOP" MACRO LIBRARY

    306	001430	001514 				BEQ	40$			;NO, TOP IS ALREADY OPEN

    307	001432	005067 	000000G		10$:	CLR	MLBBOT			;CLEAR ADDRESS OF READ BUFFER

    308	001436					CLOSE$	#MLBBLK			;NO, CLOSE THE ONE THAT'S OPEN

    309	001446	016701 	176646 			MOV	MLBPTR,R1		;GET ADDRESS OF ID BLOCK

    310	001452	010167 	000000G			MOV	R1,LASTML		;REMEMBER WHO WE'RE OPENING

    311	001456	005721 				TST	(R1)+			;POINT TO FILE ID

    312	001460	012702 	000000C			MOV	#MLBBLK+F.FNB+N.FID,R2	;POINT TO FILE ID IN MLB BLOCK

    313	001464	012122 				MOV	(R1)+,(R2)+		;COPY FILE ID INTO MLB BLOCK

    314	001466	012122 				MOV	(R1)+,(R2)+		;

    315	001470	012122 				MOV	(R1)+,(R2)+		;

    316	001472	012162 	000000C			MOV	(R1)+,N.DVNM-<N.FID+6>(R2) ;COPY DEVICE NAME

    317	001476	012162 	000000C			MOV	(R1)+,N.UNIT-<N.FID+6>(R2) ;COPY UNIT NUMBER

    318	001502				20$:	OFNB$R	#MLBBLK			;OPEN MACRO LIBRARY (SETS UP R0)

    319	001520	103003 				BCC	30$			;SKIP IF SUCCESSFUL

    320	001522	004767 	000000G			JSR	PC,OPNFAIL		;OPEN FAILURE, INVESTIGATE CAUSE

    321	001526	000765 				BR	20$			;TRY TO OPEN AGAIN

    322	001530	012167 	000000G		30$:	MOV	(R1)+,MNCNT		;SET NUMBER OF MACRO NAME TABLE ENTRIES

    323	001534	011167 	000000G			MOV	(R1),BLKVBN		;SET STARTING VIRTUAL BLOCK NUMBER

    324	001540	001050 				BNE	40$			;IF NE ALREADY FILLED IN

    325	001542	012702 	000004'			MOV	#MLBBUF,R2		;GET ADDRESS OF BUFFER TO READ LABEL INTO

    326	001546	010267 	176564 			MOV	R2,MLBQIO+Q.IOPL	;SET I/O BUFFER ADDRESS

    327	001552	012767 	000310 	176560 		MOV	#200.,MLBQIO+Q.IOPL+2	;SET TRANSFER BYTE COUNT

    328	001560	012767 	000001 	176560 		MOV	#1,MLBQIO+Q.IOPL+10	;SET STARTING VIRTUAL BLOCK NUMBER

    329	001566					DIR$	#MLBQIO			;READ LIBRARY LABLE BLOCK

    330	001574	103433 				BCS	50$			;IF CS DIRECTIVE ERROR

    331	001576	105767 	176550 			TSTB	MLIOSB			;ANY I/O ERROR?

    332	001602	002430 				BLT	50$			;IF LT YES

    333	001604	122762 	000001 	000000 		CMPB	#TY$MAC,L$TYP(R2)	;IS THIS REALLY A MACRO LIBRARY

    334	001612	001024 				BNE	50$			;NO, ERROR

    335	001614	122762 	000201 	000001 		CMPB	#ID$,L$ID(R2)		;CHECK LIBRARY ID

    336	001622	001020 				BNE	50$			;BAD ID

    337	001624	016267 	000036 	000000G		MOV	L$MI(R2),MNCNT		;GET NUMBER OF MACRO NAMES

    338	001632	166267 	000040 	000000G		SUB	L$MA(R2),MNCNT		;

    339	001640	016267 	000034 	000000G		MOV	L$MT(R2),BLKVBN		;GET BLK NO. OF MACRO NAME TABLE

    340	001646	016711 	000000G			MOV	BLKVBN,(R1)		;SAVE STARTING VIRTUAL BLOCK NUMBRT

    341	001652	016741 	000000G			MOV	MNCNT,-(R1)		;SAVE NUMBER OF MACRO NAME TABLE ENTRIES

    342	001656	005267 	000000G			INC	GETLIB			;COUNT I/O TO READ LABEL BLOCK

    343	001662	000207 			40$:	RETURN				;

    344	001664	000167 	000376 		50$:	JMP	LIBERR			;SIGNAL LIBRARY ERROR

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 10

CMPMAC		COMPARE MACRO NAMES



    346					.SBTTL	CMPMAC		COMPARE MACRO NAMES

    347					;++

    348					; THIS ROUTINE COMPARES THE INPUT MACRO NAME AGAINST THE MACRO NAME WHOSE BYTE

    349					; INDEX IS IN R1, AND RETURNS THE COMPARISON STATUS IN THE CONDITION CODES.

    350					;

    351					; RETURN STATUS:

    352					;

    353					;	EQ = EXACT MATCH FOUND

    354					;	LO = INPUT NAME LESS THAN LIBRARY NAME

    355					;	HI = INPUT NAME GREATER THAN LIBRARY NAME

    356					;--

    357

    358	001670				CMPMAC:					;

    359	001670	066701 	176442 			ADD	MLBQIO+Q.IOPL,R1	;GET ADDRESS OF MACRO NAME

    360	001674	012167 	176414 			MOV	(R1)+,MLBMAC		;SAVE LOCATION OF MACRO

    361	001700	012167 	176412 			MOV	(R1)+,MLBMAC+2		;

    362	001704				CMPSYM:					;

    363	001704	010103 				MOV	R1,R3			;SAVE ADDRESS OF MACRO NAME LENGTH

    364	001706	016702 	000000G			MOV	FREEPT,R2		;POINT TO INPUT MACRO NAME BLOCK

    365	001712	062702 	000011 			ADD	#SYMLEN,R2		;POINT TO LENGTH BYTE

    366	001716	112200 				MOVB	(R2)+,R0		;GET LENGTH OF CURRENT SYMBOL

    367	001720	120021 				CMPB	R0,(R1)+		;CURRENT SYMBOL HAVE SHORTER LENGTH?

    368	001722	101402 				BLOS	10$			;IF LOS YES

    369	001724	116100 	177777 			MOVB	-1(R1),R0		;GET LENGTH FROM LIBRARY SYMBOL

    370	001730	005400 			10$:	NEG	R0			;NEGATE LENGTH OF SYMBOL

    371	001732	062700 	000017 			ADD	#15.,R0			;CALCULATE COMPLEMENT BASE 15.

    372	001736	072027 	000002 			ASH	#2,R0			;MULTIPLY BY 4

    373	001742	060007 				ADD	R0,PC			;DISPATCH TO PROPER ROUTINE

    374		000017 				.REPT	15.

    375						CMPB	(R2)+,(R1)+		;COMPARE SYMBOLS

    376						BNE	20$			;IF NE NO MATCH

    377						.ENDR

    378	002040	016702 	000000G			MOV	FREEPT,R2		;GET ADDRESS OF CURRENT MACRO NAME SYMBOL

    379	002044	126213 	000011 			CMPB	SYMLEN(R2),(R3)		;COMPARE SYMBOL LENGTHS

    380	002050	000207 			20$:	RETURN				;

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 11

MCALL		".MCALL" DIRECTIVE



    382					.SBTTL	MCALL		".MCALL" DIRECTIVE

    383					;++

    384					;

    385					; THIS ROUTINE SCANS THE REST OF THE LINE PASSING MACRO NAMES TO "IMCALL"

    386					; SO THAT THEY ARE READ INTO MEMORY AND DEFINED.

    387					;

    388					;--

    389

    390	002052				MCALL::				; DIRECTIVE = KMCALL

    391	002052	016767 	000000G	000000G		MOV	LINEPT,ERRPT		; SET ERROR POINTER TO SYMBOL NAME

    392	002060	005367 	000000G			DEC	ERRPT			;

    393	002064	004767 	000000G			JSR	PC,SYMSCN		; PICK UP NEXT SYMBOL ON LINE

    394	002070	005703 				TST	R3			; WAS THERE A SYMBOL?

    395	002072	001005 				BNE	10$			; SKIP IF SYMBOL FOUND

    396	002074	012700 	000000G			MOV	#DIRERR,R0		; DIRECTIVE SYNTAX ERROR MESSAGE

    397	002100	004767 	000000G			JSR	PC,ERORPT		; REPORT ERROR

    398	002104	000435 				BR	MCALLX			; EXIT ROUTINE

    399	002106	062702 	000000G		10$:	ADD	#MACNAM,R2		; ADD HASH TO MACRO NAME TABLE

    400	002112	005067 	000000G			CLR	INSERT			; MAKE "INSERT" FALSE

    401	002116	004767 	000000G			JSR	PC,FINDSYM		; JUST LOOK FOR MACRO NAME

    402	002122	005702 				TST	R2			; IS MACRO ALREADY DEFINED?

    403	002124	001011 				BNE	20$			; SKIP IF DEFINED

    404	002126	004767 	176224 			JSR	PC,IMCALL		; LOOK THRU MACRO LIBRARIES FOR IT

    405	002132	022700 	000000G			CMP	#MACTXT,R0		; WAS MACRO FOUND AND DEFINED?

    406	002136	001404 				BEQ	20$			; SKIP IF FOUND

    407	002140	012700 	000000G			MOV	#NOMAC,R0		; MACRO NOT FOUND MESSAGE

    408	002144	004767 	000000G			JSR	PC,ERORPT		; REPORT ERROR

    409	002150				20$:	SPNOR				; SKIP OVER BLANKS

    410	002154	022767 	000054 	000000G		CMP	#COMMA,CHAR		; IS FIRST NON-BLANK A COMMA?

    411	002162	001002 				BNE	30$			; SKIP IF NOT

    412	002164	004767 	000000G			JSR	PC,GETCHR		; READ NEXT CHARACTER

    413	002170	022767 	000015 	000000G	30$:	CMP	#CR,CHAR		; IS THIS "EOL"

    414	002176	001325 				BNE	MCALL			; LOOP UNTIL "EOL"

    415	002200				MCALLX:

    416	002200	000207 				RTS	PC			; RETURN

    417

    418

    419

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 12

MLBLIN		COPY LINE FROM MACRO LIBRARY INTO MEMORY



    421					.SBTTL	MLBLIN		COPY LINE FROM MACRO LIBRARY INTO MEMORY

    422					;++

    423					;

    424					; THIS ROUTINE IS CALLED BY "MACRO" AS THE PRIMARY INPUT ROUTINE AFTER

    425					; "MSETUP" HAS SWITCHED THE INPUT CONTEXT TO BE A MACRO LIBRARY.

    426					;

    427					;--

    428	002202				MLBLIN::

    429	002202	005267 	000000G			INC	GETMAC			;;; COUNT EACH LINE READ IN

    430	002206					GET$S	#MLBBLK,#LINEBF		; READ NEXT LINE

    431	002224	103002 				BCC	10$			; SKIP IF NO ERROR ON READ

    432	002226	004767 	000000G			JSR	PC,MEXIT		; TERMINATE MACRO DEFINITION

    433	002232	016767 	000000C	000000G	10$:	MOV	MLBBLK+F.NRBD,LINELN	; SAVE LINE LENGTH

    434	002240	012700 	000000G			MOV	#LINEBF,R0		; POINT TO LINE'S START

    435	002244	010067 	000000G			MOV	R0,LINEPT		; SAVE START OF LINE

    436	002250	010067 	000000G			MOV	R0,ERRPTX		; INITIALIZE ERROR POINTER

    437	002254	066700 	000000G			ADD	LINELN,R0		; POINT TO END OF LINE

    438	002260	112710 	000015 			MOVB	#CR,(R0)		; STORE CARRIAGE RETURN AT END OF LINE

    439	002264				MLBLIX:

    440	002264	000207 				RTS	PC			; RETURN

    441

    442

    443

    444

    445					.SBTTL	LIBERR		LIBRARY FORMAT ERROR

    446					;++

    447					;

    448					; SIGNAL ERROR IN THE FORMAT OF A FILE SPECIFIED AS A MACRO LIBRARY.

    449					;

    450					;--

    451

    452	002266				LIBERR::

    453

    454	002266	012700 	000000G			MOV	#MLIBER,R0		; LIBRARY FORMAT ERROR MESSAGE

    455	002272	004767 	000000G			JSR	PC,ERORPT		; REPORT ERROR

    456	002276	000167 	000000G			JMP	DIE1			; TERMINATE ASSEMBLY, LIBRARY ERROR

    457

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 13

MSETUP		CHANGE INPUT CONTEXT TO MACRO LIBRARY



    459					.SBTTL	MSETUP		CHANGE INPUT CONTEXT TO MACRO LIBRARY

    460					;++

    461					;

    462					; MSETUP -- SAVE INPUT CONTEXT AND SWITCH INPUT STREAM TO MACRO LIBRARY

    463					;	    IN ORDER TO READ AND DEFINE A MACRO FROM THE LIBRARY.

    464					;--

    465

    466	002302				MSETUP::

    467	002302					SAVRG				; SAVE R1 - R3

    468	002306	012700 	000000G			MOV	#MLBBLK,R0		; ADDRESS OF FDB

    469	002312					FDAT$R	R0,#R.VAR,#0,#200.	; NEW BUFFER DATA

    470	002332					FDRC$R	R0,,#MLBBUF,#200.	; RESET BUFFER ATTRIBUTES

    471	002346	005001 				CLR	R1			; HIGH ORDER BITS OF VIRT. BLOCK NO.

    472	002350	016702 	175740 			MOV	MLBMAC,R2		; LOW ORDER BITS OF VIRT. BLOCK NO.

    473	002354	016703 	175736 			MOV	MLBMAC+2,R3		; BYTE NO. IN BLOCK

    474	002360	004767 	000000G			JSR	PC,.POINT		; POINT TO MODULE HEADER

    475	002364					GET$S				; GET THE HEADER

    476	002370	032777 	000001 	000000C		BIT	#1,@MLBBLK+F.NRBD+2	; DELETED?

    477	002376	001402 				BEQ	1$			; NO

    478	002400	000261 				SEC				; YES, SIGNAL ERROR

    479	002402	000525 				BR	MSETUX			; EXIT

    480

    481	002404	016703 	000000G		1$:	MOV	FRIEND,R3		; SAVE INPUT LINE IN HIGH CORE

    482	002410	010300 				MOV	R3,R0			; COPY POINTER

    483	002412	162700 	000204 			SUB	#132.,R0		; RESERVE 132 BYTES

    484	002416	020067 	000000G			CMP	R0,FREEPT		; OUT OF ROOM?

    485	002422	101002 				BHI	10$			; NO

    486	002424	000167 	000000G			JMP	DIE			; YES, SYMBOL TABLE FULL

    487	002430	012702 	000000G		10$:	MOV	#LINEBF,R2		; PTR TO CURRENT INPUT LINE

    488	002434	016700 	000000G			MOV	LINELN,R0		; LINE'S LENGTH (BYTES)

    489	002440	006200 				ASR	R0			; DIVIDE BY 2 (WORDS)

    490	002442	005200 				INC	R0			; ROUND UP, INCLUDE "CR"

    491	002444	012243 			20$:	MOV	(R2)+,-(R3)		; COPY LINE TO HIGH CORE

    492	002446	077002 				SOB	R0,20$			; ONCE PER WORD

    493

    494	002450	016743 	000000G			MOV	CONTLN,-(R3)		; SAVE INPUT CONTEXT

    495	002454	016743 	000000G			MOV	NEXTCH,-(R3)		; NEXT CHARACTER

    496	002460	016743 	000000G			MOV	CHAR,-(R3)		; CURRENT CHAR

    497	002464	016743 	000000G			MOV	LINENM,-(R3)		; LINE NUMBER

    498	002470	005067 	000000G			CLR	LINENM			; CLEAR LINE NUMBER

    499	002474	016743 	000000G			MOV	LINEPT,-(R3)		; LINE POINTER

    500	002500	016743 	000000G			MOV	LINELN,-(R3)		; LINE'S LENGTH

    501	002504	010346 				MOV	R3,-(SP)		; PUSH POINTER

    502	002506	162703 	000020 			SUB	#M.ARGS+2,R3		; ALLOCATE INPUT BLOCK

    503	002512	016702 	000000G			MOV	INPUTP,R2		; POINT TO CURRENT INPUT BLOCK

    504	002516	010263 	000000 			MOV	R2,M.LINK(R3)		; LINK TO PREVIOUS BLOCK

    505	002522	012663 	000002 			MOV	(SP)+,M.NXTL(R3)	; LINE POINTER

    506	002526	012763 	002202'	000004 		MOV	#MLBLIN,M.GETL(R3)	; LINE READER

    507	002534	016763 	000000G	000012 		MOV	FRIEND,M.END(R3)	; END OF FRAME

    508	002542	010367 	000000G			MOV	R3,FRIEND		; ALLOCATE IT

    509	002546	010367 	000000G			MOV	R3,INPUTP		; SET NEW INPUT CONTEXT

    510

    511	002552					FDRC$R	#MLBBLK,,#LINEBF,#400. ; MOVE MODE, "LINEBF" IS BUFFER

    512

    513	002572	012767 	000015 	000000G		MOV	#CR,CHAR		; FORCE READING OF NEW LINE

    514	002600	004767 	000000G			JSR	PC,GETCHR		; READ NEW LINE

    515	002604	004767 	000000G			JSR	PC,SYMSCN		; SCAN FIRST SYMBOL

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 13-1

MSETUP		CHANGE INPUT CONTEXT TO MACRO LIBRARY



    516	002610	005703 				TST	R3			; FIND SYMBOL?

    517	002612	001417 				BEQ	30$			; NO, ERROR EXIT

    518	002614	062702 	000000G			ADD	#HASHP,R2		; POINT TO PERMANENT SYMBOL TABLE

    519	002620	005067 	000000G			CLR	INSERT			; DON'T ADD NEW ONE

    520	002624	004767 	000000G			JSR	PC,FINDSYM		; LOOK FOR ".MACRO"

    521	002630	005702 				TST	R2			; FOUND?

    522	002632	001407 				BEQ	30$			; NO!  ERROR

    523	002634	016200 	000002 			MOV	SYMFLAGS(R2),R0		; GET IT'S FLAGS

    524	002640	042700 	177400 			BIC	#^CS.TKMSK,R0		; MASK OUT GARBAGE

    525	002644	020027 	000000G			CMP	R0,#KMACRO		; .MACRO?

    526	002650	001402 				BEQ	MSETUX			; YES, EXIT

    527	002652	000167 	177410 		30$:	JMP	LIBERR			; SIGNAL LIBRARY ERROR

    528	002656				MSETUX:

    529	002656	000207 				RTS	PC			; LOOKS OK!

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 14

MRESTORE	RESTORE INPUT CONTEXT AFTER LIBRARY MACRO DEF



    531					.SBTTL	MRESTORE	RESTORE INPUT CONTEXT AFTER LIBRARY MACRO DEF

    532					;

    533					; MRESTORE -- RESTORE INPUT CONTEXT AFTER THE IMPLIED DEFINITION OF

    534					;	      A MACRO FROM A MACRO LIBRARY.

    535					;

    536

    537	002660				MRESTORE::

    538	002660	016703 	000000G			MOV	INPUTP,R3		; POINT TO INPUT BLOCK

    539	002664	016367 	000012 	000000G		MOV	M.END(R3),FRIEND	; DEALLOCATE BLOCK

    540	002672	016367 	000000 	000000G		MOV	M.LINK(R3),INPUTP	; SET OLD INPUT BLOCK PTR

    541	002700	016302 	000002 			MOV	M.NXTL(R3),R2		; POINT TO SAVED WORDS

    542	002704	012267 	000000G			MOV	(R2)+,LINELN		; RESTORE CONTEXT

    543	002710	012267 	000000G			MOV	(R2)+,LINEPT		; INPUT POINTER

    544	002714	012267 	000000G			MOV	(R2)+,LINENM		; LINE NUMBER

    545	002720	012267 	000000G			MOV	(R2)+,CHAR		; CURRENT CHAR

    546	002724	012267 	000000G			MOV	(R2)+,NEXTCH		; NEXT CHAR

    547	002730	012267 	000000G			MOV	(R2)+,CONTLN		; CONTINUATION FLAG

    548	002734	016702 	000000G			MOV	FRIEND,R2		; START OF SAVED LINE

    549	002740	016700 	000000G			MOV	LINELN,R0		; LINE'S LENGTH

    550	002744	006200 				ASR	R0			; DIVIDE BY 2

    551	002746	005200 				INC	R0			; ROUND UP, INCLUDE "CR"

    552	002750	012703 	000000G			MOV	#LINEBF,R3		; LINE BUFFER POINTER

    553	002754	014223 			1$:	MOV	-(R2),(R3)+		; COPY LINE

    554	002756	077002 				SOB	R0,1$			; ONCE PER WORD

    555

    556	002760	005767 	000006G			TST	LS.MC+SYMVL2		; LISTING MACRO CALLS?

    557	002764	001410 				BEQ	MRESTX			; NO, EXIT

    558	002766					    OUT #I.FLAG,<#-1,#LISTIT>	; INSURE CALL GETS LISTED

    559	003006				MRESTX:

    560	003006	000207 				RTS	PC			; AND EXIT

    561

    562

    563		000001 			.END

MACLIB	MACRO M1110  21-AUG-78 22:54  PAGE 14-1

SYMBOL TABLE



BLKCUR  000000R     003	GETMAC= ****** GX	L$MS    000032 G    002	MSETUX  002656R     003	SKIPSP= ****** GX

BLKMAX  000002R     003	GETPSC= ****** GX	L$MT    000034 G    002	M.ARGC= 000014   	SPACE = 000040

BLKVBN= ****** GX	HASHP = ****** GX	L$MXLN  000056 G    002	M.ARGS= 000016   	SYMCHR= 000012

BLNK  = 000040   	ID$   = 000201 G 	L$NX    000052 G    002	M.END = 000012   	SYMFLA= 000002

CHAR  = ****** GX	IMCALL  000356RG    003	L$TYP   000000 G    002	M.GETL= 000004   	SYMLEN= 000011

CMPMAC  001670R     003	INPUTP= ****** GX	L$VER   000002 G    002	M.IFLV= 000006   	SYMLIN= 000000

CMPSYM  001704R     003	INSERT= ****** GX	MACLBF= ****** GX	M.IFVL= 000010   	SYMMAX= 000017

CNT   = 000006   	IO.RVB= ****** GX	MACNAM= ****** GX	M.LINK= 000000   	SYMSCN= ****** GX

COMMA = 000054   	I.FLAG= ****** GX	MACRO = ****** GX	M.NXTL= 000002   	SYMSEG= 000010

CONTLN= ****** GX	KMACRO= ****** GX	MACTXT= ****** GX	NEXTCH= ****** GX	SYMVL1= 000004

CR    = 000015   	LASTML= ****** GX	MAXNAM= 000031   	NOMAC = ****** GX	SYMVL2= 000006

CURMLB= ****** GX	LF    = 000012   	MCALL   002052RG    003	NXTMLB  001412R     003	S.ABS = 004000

DIE   = ****** GX	LFTANG= 000074   	MCALLX  002200R     003	N.DVNM= ****** GX	S.ASN = 000200

DIE1  = ****** GX	LIBERR  002266RG    003	MCNAM = ****** GX	N.FID = ****** GX	S.DBG = 002000

DIRERR= ****** GX	LINEBF= ****** GX	MEXIT = ****** GX	N.UNIT= ****** GX	S.DF  = 100000

ERORPT= ****** GX	LINELN= ****** GX	MLBBLK= ****** GX	OPNFAI= ****** GX	S.EPT = 000100

ERRPT = ****** GX	LINENM= ****** GX	MLBBOT= ****** GX	OUTFRA= ****** GX	S.EXTN= 010000

ERRPTX= ****** GX	LINEPT= ****** GX	MLBBUF  000004R     003	PAR$$$= 000027   	S.GLOB= 020000

ERR03 = ****** GX	LISTIT= ****** GX	MLBIND= ****** GX	PSECCH= 000020   	S.LOCL= 001000

FF    = 000014   	LOWCAS= 000140   	MLBLEN= ****** GX	PSECOP= 000016   	S.ODBG= 000040

FINDSY= ****** GX	LPTLEN= 000074   	MLBLIN  002202RG    003	PSECV1= 000012   	S.REF = 000400

FO.RD = ****** GX	LS.MC = ****** GX	MLBLIX  002264R     003	PSECV2= 000014   	S.TKMS= 000377

FREEPT= ****** GX	L$BUF   000000 G    002	MLBMAC  000314R     003	Q.IOAE= 000012   	S.WEAK= 040000

FRIEND= ****** GX	L$DAT   000006 G    002	MLBPTR  000320R     003	Q.IOEF= 000006   	TAB   = 000011

F.FACC= ****** GX	L$EA    000030 G    002	MLBQIO  000322R     003	Q.IOFN= 000002   	TY$MAC= 000001 G

F.FNB = ****** GX	L$EI    000026 G    002	MLIBER= ****** GX	Q.IOLU= 000004   	$$$ARG= 000000

F.NRBD= ****** GX	L$ES    000022 G    002	MLIOSB  000352R     003	Q.IOPL= 000014   	$$$OST= 000014

F.RATT= ****** GX	L$ET    000024 G    002	MNCNT = ****** GX	Q.IOPR= 000007   	.CLOSE= ****** G

F.RSIZ= ****** GX	L$ID    000001 G    002	MNLEN = 000024   	Q.IOSB= 000010   	.GETSQ= ****** G

F.RTYP= ****** GX	L$LA    000046 G    002	MRESTO  002660RG    003	RGTANG= 000076   	.OPFNB= ****** G

F.URBD= ****** GX	L$LD    000042 G    002	MRESTX  003006R     003	R.VAR = ****** GX	.POINT= ****** GX

GETCHR= ****** GX	L$MA    000040 G    002	MSETUP  002302RG    003	SEMI  = 000073   	.SAVRG= ****** GX

GETLIB= ****** GX	L$MI    000036 G    002



. ABS.	000000	   000

      	000000	   001

BUFFER	000060	   002

MACLIB	003010	   003

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  3642 WORDS  ( 15 PAGES)

DYNAMIC MEMORY:  4884 WORDS  ( 18 PAGES)

ELAPSED TIME:  00:00:25

OBJ$:MACLIB,LIS$:MACLIB/-SP=SRC$:COMMON,MACLIB

