P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11

TABLE OF CONTENTS



    32-    3	STORE DATA FROM LINKER'S STACK

    33-   44	STORE REPEATED DATA

    34-   94	STORE IMMEDIATE DATA

    35-  143	PSECT ROUTINES

    36-  229	MISCELLANEOUS ROUTINES

    38-  337	ERROR PROCESSING

    39-  408	DECIMAL OUTPUT ROUTINE

    40-  447	PROGRAM COUNTER CONTROL

    41-  479	ENTRY POINT DEFINITION

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 26





      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$

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 32





      1					.TITLE P2ACT2	PASS 2 ACTION ROUTINES

      2	000000				.PSECT	P2ACT2

      3					.SBTTL	STORE DATA FROM LINKER'S STACK

      4

      5	000000				P.STSB::				; STORE SIGNED BYTE

      6	000000					GEN STOB

      7	000010					IF LSTLPT LO #LSTLND+2 THEN

      8	000020					    CALL P.FNEWL			; START NEW LINE

      9	000024					END

     10	000024	112777 	000047 	000000G		MOVB	#'',@LSTLPT			; PUT QUOTE IN LISTING

     11	000032					FORMAT #1

     12	000042					RETURN

     13

     14	000044				P.STSW::				; STORE SIGNED WORD

     15	000044					GEN STOW

     16	000054					IF LSTLPT LO #LSTLND+4 THEN

     17	000064					    CALL P.FNEWL			; START NEW LINE

     18	000070					END

     19	000070	112777 	000047 	000000G		MOVB	#'',@LSTLPT			; PUT QUOTE IN LISTING

     20	000076					FORMAT #2

     21	000106					RETURN

     22

     23	000110				P.SPID::				; STORE ADDRESS

     24	000110					GEN STOPID				; POSITION INDEP. DATA

     25	000120					GOTO PLONG				; PRINT LONGWORD

     26	000122				P.STOL::				; STORE LONGWORD

     27	000122					GEN STOL

     28	000132				PLONG:	IF LSTLPT LO #LSTLND+8. THEN

     29	000142					    CALL P.FNEWL			; START NEW LINE

     30	000146					END

     31	000146	112777 	000047 	000000G		MOVB	#'',@LSTLPT			; PUT QUOTE IN LISTING

     32	000154					FORMAT #4

     33	000164					RETURN

     34

     35	000166				P.STOV::				; STORE FIELD

     36	000166					GEN STOV

     37	000176					IF LSTLPT LO #LSTLND+8. THEN

     38	000206					    CALL P.FNEWL			; START NEW LINE

     39	000212					END

     40	000212	112777 	000047 	000000G		MOVB	#'',@LSTLPT			; PUT QUOTE IN LISTING

     41	000220					FORMAT #4

     42	000230					RETURN

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 33

STORE REPEATED DATA



     44					.SBTTL	STORE REPEATED DATA

     45

     46	000232				P.STRB::				; STORE REPEATED BYTE

     47	000232					GEN STORB

     48	000242					LPOP R1,R0

     49	000256					LPOP R2,R3

     50	000272					IF R1 IS NE THEN

     51	000276					REPEAT THRU R1

     52	000276					    LPUSH R2,R3

     53	000312					    IF LSTLPT LO #LSTLND+2 THEN

     54	000322						CALL P.FNEWL			; START NEW LINE

     55	000326					    END

     56	000326	112777 	000047 	000000G		    MOVB #'',@LSTLPT			; PUT QUOTE IN LISTING

     57	000334					    FORMAT #1

     58	000344					END;R

     59	000346					END;IF

     60	000346					RETURN

     61

     62	000350				P.STRW::				; STORE REPEATED WORD

     63	000350					GEN STORW

     64	000360					LPOP R1,R0

     65	000374					LPOP R2,R3

     66	000410					IF R1 IS NE THEN

     67	000414					REPEAT THRU R1

     68	000414					    LPUSH R2,R3

     69	000430					    IF LSTLPT LO #LSTLND+4 THEN

     70	000440						CALL P.FNEWL			; START NEW LINE

     71	000444					    END

     72	000444	112777 	000047 	000000G		    MOVB #'',@LSTLPT			; PUT QUOTE IN LISTING

     73	000452					    FORMAT #2

     74	000462					END;R

     75	000464					END;IF

     76	000464					RETURN

     77

     78	000466				P.STRL::				; STORE REPEATED LONG

     79	000466					GEN STORL

     80	000476					LPOP R1,R0

     81	000512					LPOP R2,R3

     82	000526					IF R1 IS NE THEN

     83	000532					REPEAT THRU R1

     84	000532					    LPUSH R2,R3

     85	000546					    IF LSTLPT LO #LSTLND+8. THEN

     86	000556						CALL P.FNEWL			; START NEW LINE

     87	000562					    END

     88	000562	112777 	000047 	000000G		    MOVB #'',@LSTLPT			; PUT QUOTE IN LISTING

     89	000570					    FORMAT #4

     90	000600					END;R

     91	000602					END;IF

     92	000602					RETURN

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 34

STORE IMMEDIATE DATA



     94					.SBTTL	STORE IMMEDIATE DATA

     95

     96	000604				P.STIB::				; STORE IMMEDIATE BYTE

     97	000604					IF LSTLPT LO #LSTLND+2 THEN

     98	000614					    CALL P.FNEWL			; START NEW LINE

     99	000620					END

    100	000620					LPUSH		(R5),2(R5)		; STACK VALUE

    101	000636					CALL		BCHK			; CHECK FOR TRUNCATION

    102	000642					LET R0		:B= (R5)+		; GET VALUE

    103	000644					CALL STOIM				; STORE IT

    104	000650					FORMAT		#1

    105	000660					RETURN

    106

    107	000662				P.STIW::				; STORE IMMEDIATE WORD

    108	000662					IF LSTLPT LO #LSTLND+4 THEN

    109	000672					    CALL P.FNEWL			; START NEW LINE

    110	000676					END

    111	000676					LPUSH		(R5),2(R5)		; STACK VALUE

    112	000714					CALL		WCHK			; CHECK FOR TRUNCATION

    113	000720					LET R0		:B= (R5)+		; VALUE

    114	000722					CALL STOIM				; STORE IT

    115	000726					LET R0		:B= (R5)+		; VALUE

    116	000730					CALL STOIM				; STORE IT

    117	000734					FORMAT		#2

    118	000744					RETURN

    119

    120	000746				P.STIL::				; STORE IMMEDIATE LONG

    121	000746					IF LSTLPT LO #LSTLND+8. THEN

    122	000756					    CALL P.FNEWL			; START NEW LINE

    123	000762					END

    124	000762					LPUSH		(R5),2(R5)		; STACK VALUE

    125	001000					LET R0		:B= (R5)+		; VALUE

    126	001002					CALL STOIM				; STORE IT

    127	001006					LET R0		:B= (R5)+		; VALUE

    128	001010					CALL STOIM				; STORE IT

    129	001014					LET R0		:B= (R5)+		; VALUE

    130	001016					CALL STOIM				; STORE IT

    131	001022					LET R0		:B= (R5)+		; VALUE

    132	001024					CALL STOIM				; STORE IT

    133	001030					FORMAT		#4

    134	001040					RETURN

    135

    136	001042				P.PRIL::				; PRINT IMMEDIATE LONG

    137	001042					LPUSH		(R5)+,(R5)+		; PUSH VALUE

    138	001056					FORMAT		#4			; PRINT IT

    139	001066					DECRPC		#4			; BUT DON'T INCR PC

    140	001100					RETURN

    141

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 35

PSECT ROUTINES



    143					.SBTTL	PSECT ROUTINES

    144

    145	001102				P.NEWP::				; DEFINE NEW PSECT

    146	001102					LET R1		:= (R5)			; POINT TO SYMBOL BLOCK

    147	001104					LET RECTYP	:= #OB.GSD		; GLOBAL SYMBOL DIRECTORY

    148	001112					CALL WRTOBJ				; FLUSH PREVIOUS RECORD

    149	001116					DATA	#GS.PDF				; GSD TYPE = PSECT DEF

    150	001130					LET R0		:= PSECOP(R1) OFF.BY #140777 ; GET ALIGNMENT

    151	001140					LET R0		:= R0 SHIFT #-9.	; RIGHT JUSTIFY ALIGNMENT

    152	001144					DATA R0					; OUTPUT ALIGNMENT FACTOR

    153	001154					LET R0		:= PSECOP(R1)		; GET FLAGS

    154	001160					DATA R0					; OUTPUT LOWER BYTE

    155	001170	000300 				SWAB R0					; GET UPPER BYTE

    156	001172					LET R0		:= R0 OFF.BY #^C1	; SAVE BIT 0

    157	001176					DATA R0					; OUTPUT FLAG (BIT 8)

    158	001206					IF #FP.REL OFF.IN PSECOP(R1) THEN	; ABSOLUTE P-SECT ?

    159	001216	005061 	000004 			    CLR	SYMVL1(R1)			; OUTPUT LENGTH OF ZERO

    160	001222	005061 	000006 			    CLR	SYMVL2(R1)			;

    161	001226					END

    162	001226					LET R2		:= R1 + #SYMVL1		; POINT TO SIZE

    163	001234					REPEAT THRU R0 := #4			; FILL IN MAX ALLOCATION

    164	001240					    DATA (R2)+

    165	001250					END

    166	001252					CALL OBJPSCT				; OUTPUT P-SECT NAME

    167	001256					LET RECTYP	:= #OB.TIR		; RESET FOR TIR

    168	001264					CALL WRTOBJ				; WRITE OUT RECORD

    169	001270					LET SYMVL1(R1)	:= 0			; START AT RELATIVE 0

    170	001274					LET SYMVL2(R1)	:= 0

    171	001300					RETURN

    172

    173	001302				P.PSECT::				; CHANGE PSECT

    174	001302					CALL	SETPC				; UPDATE PC

    175	001306					LET R0		:= (R5)			; POINT TO NEW PSECT

    176	001310					LET PC1		:= SYMVL1(R0)		; GET NEW PC

    177	001316					LET PC2		:= SYMVL2(R0)		;

    178	001324					GOTO	PSCRES				; GO TO PSECT / RESTORE CODE

    179

    180	001326				P.REST::				; RESTORE PSECT FROM STACK

    181	001326					CALL	SETPC				; UPDATE MAXIMUM LOCATION COUNTER

    182	001332					LET R0		:= (R5)			; GET ADDRESS OF PSECT BLOCK

    183	001334					LET PC1		:= PSECV1(R0)		; RESTORE LOCATION COUNTER

    184	001342					LET PC2		:= PSECV2(R0)		;

    185

    186	001350				PSCRES:						; COMMON CODE FOR PSECT / RESTORE

    187	001350					LET MEBLST	:= #-1			; FORCE LISTING OF "PSECT" OR "RESTORE"

    188	001356					LET PSTNUM	:B= SYMSEG(R0)		; LOAD PSECT NUMBER

    189	001364					LET PSECTP	:= R0			; SAVE ADDRESS OF PSECT BLOCK

    190	001370					LET R1	:= #4				; ASSUME LONGWORD OFFSET

    191	001374					LET R2	:= #STPBL

    192	001400					IF PC2 IS EQ AND PC1 IS GE THEN		; OPTIMIZE

    193	001414					    LET R1	:= #2			; USE WORD OFFSET

    194	001420					    LET R2	:= #STPBW

    195	001424					    IFB PC1+1 IS EQ ANDB PC1 IS GE THEN	; OPTIMIZE?

    196	001440						LET R1	:= #1			; USE BYTE OFFSET

    197	001444						LET R2	:= #STPBB

    198	001450					    END

    199	001450					END

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 35-1

PSECT ROUTINES



    200

    201	001450					DATA	R2				; STACK COMMAND

    202	001460					DATA	PSTNUM				; PSECT NUMBER

    203	001472					LET R2	:= #PC1				; POINT TO VALUE

    204	001476					REPEAT THRU R1				; FOR SELECTED SIZE

    205	001476					    DATA (R2)+

    206	001506					END

    207	001510					GEN SETRB				; SET RELOCATION BASE

    208	001520					LET LSTLPT	:= #LSTLCT		; POINT TO END OF BUFFER

    209	001526					LPUSH		PC1,PC2			; PUSH PC

    210	001546					IF PSECTP EQ #BLNKP AND PC1 IS EQ AND PC2 IS EQ THEN

    211											; BLANK PSECT, LOCATION ZERO

    212	001572					    FORMAT	#2			; USE SHORT PC

    213	001602					    DECRPC	#2			; RESTORE VALUE

    214	001614					    CALL LSTCHAR <#SPACE>		; PRINT SPACE AFTER PC

    215	001624					ELSE

    216	001626					    FORMAT	#4			; PRINT WIDE PC

    217	001636					    DECRPC	#4			; BUT DON'T INCREMENT

    218	001650					END

    219	001650					RETURN

    220

    221

    222	001652				P.SAVE::				; SAVE PSECT CONTEXT

    223	001652					LET R0		:= (R5)			; GET ADDRESS OF PSECT BLOCK

    224	001654					LET PSECV1(R0)	:= PC1			; SAVE CURRENT LOCATION

    225	001662					LET PSECV2(R0)	:= PC2			;

    226	001670					LET MEBLST	:= #-1			; INSURE DIRECTIVE GETS LISTED

    227	001676					RETURN					;

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 36

MISCELLANEOUS ROUTINES



    229					.SBTTL	MISCELLANEOUS ROUTINES

    230	001700				P.NEWL::				; NEW SOURCE LINE

    231	001700					LET P2LINE	:= (R5)			;SAVE ORIGINAL SOURCE LINE NUMBER

    232	001704					RETURN

    233

    234

    235	001706				P.FNEWL::				; NEW LISTING LINE

    236	001706					PUSH LISTIT

    237	001712					CALL WRTLST				; START NEW LINE

    238	001716					POP  LISTIT

    239	001722					RETURN					;

    240

    241

    242	001724				P.FLAG::				; SET FLAG

    243	001724					LET R0		:= (R5)+		; GET NEW VALUE

    244	001726					LET @0(R5)	:= R0			; SET IT IN FLAG

    245	001732					RETURN					; THAT WAS EASY

    246

    247

    248

    249	001734				P.ASN::					; ASSIGN VALUE TO SYMBOL

    250	001734					LET R0		:= (R5)+		; POINT TO SYMBOL

    251	001736					LET SYMSEG(R0)	:= (R5)+		; SEGMENT

    252	001742					LET SYMVL1(R0)	:= (R5)+		; VALUE

    253	001746					LET SYMVL2(R0)	:= (R5)+

    254	001752					IF (R5) IS EQ THEN			; THIS ASSIGMENT IS RELOCATABLE

    255	001756					    LET SYMFLAG(R0) := SYMFLAG(R0) OFF.BY #S.ABS ; TURN OFF ABSOLUTE FLAG

    256	001764					ELSE

    257	001766					    LET SYMFLAG(R0) := SYMFLAG(R0) SET.BY #S.ABS ; SET ABSOLUTE FLAG

    258	001774					END;IF

    259	001774					RETURN					; SYMBOL IS UPDATED

    260

    261

    262	001776				P.SBTTL::				; SUBTITLE

    263	001776					LET R0		:= (R5)+		; LENGTH OF SBTTL LINE

    264	002000					LET R2		:= #47. - R0		; FIND NUMBER OF BYTES TO BE " "

    265	002006					LET R1		:= #SBTLB2		; POINT TO BUFFER

    266	002012					IF R0 IS GT THEN			; COPY SUBTITLE IF NOT ZERO LEN.

    267	002016					    REPEAT THRU R0			; ONCE PER CHAR

    268	002016						LET (R1)+ :B= (R5)+		; COPY IN THE SBTTL

    269	002020					    END;R

    270	002022					END;IF

    271	002022					IF R2 IS GT THEN			; THERE NEEDS TO BE SOME BLANKS

    272	002026					    REPEAT THRU R2			;

    273	002026						LET (R1)+ :B= #SPACE		; STORE SPACE

    274	002032					    END;R

    275	002034					END;IF

    276	002034					RETURN

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 37

MISCELLANEOUS ROUTINES



    278

    279	002036				P.CHKL::				; ALIGN OBJECT CODE WITH SOURCE LINES

    280	002036					IF MACL IS TRUE THEN			; MACRO LINE PRESENT?

    281	002044					    CALL DMPMAC				; COPY MACRO LINE TO "LINEBF"

    282	002050					    LET MACL := FALSE			; NO MACRO LINE PRESENT NOW

    283	002054					ELSE

    284	002056					    PUSH LISTIT				; SAVE LISTING FLAG

    285	002062					    WHILE P2LINE GT LINENM		; NEED TO READ A LINE

    286	002072						LET LISTIT	:= (SP)		; PICK UP LISTING FLAG

    287	002076						CALL WRTLST			; WRITE OUT CURRENT LINE

    288	002102						CALL GETLIN			; GET NEXT SOURCE LINE

    289	002106						LET MACLGT	:= FALSE	; DON'T HAVE MACRO LINE

    290	002112						PUSH LSTLPT			; SAVE LINE POINTER

    291	002116						LET LSTLPT	:= #LSTLIN-1	; WHERE NUMBER GOES

    292	002124						IFB #R.SEQ EQ F.RTYP+VAXBLK THEN ; SOS RECORD?

    293	002134						    LET R3	:= F.SEQN+VAXBLK ; GET LINE NUMBER

    294	002140						ELSE

    295	002142						    LET R3	:= LINENM - LINBAS ; GET LINE NUMBER

    296	002152						END;IF

    297	002152						CALL DECOUT			; OUTPUT SEQUENCE NUMBER

    298	002156						POP LSTLPT			; RESTORE LINE POINTER

    299	002162					    END;W

    300	002164					    POP  R0				; CLEAN OFF STACK

    301	002166					END;IF

    302	002166					RETURN

    303

    304

    305	002170				P.MACL::				; READ MACRO LINE

    306	002170					IF MACL IS TRUE THEN			; ALREADY HAVE LINE?

    307	002176					    CALL DMPMAC				; COPY MACRO LINE TO "LINEBF"

    308	002202					END;IF

    309	002202					LET R1		:= #MACLBF		; POINT TO MACRO LINE BUFFER

    310	002206					LET R0		:= (R5)+		; GET LINE LENGTH

    311	002210					IF RESULT IS GT THEN			; LINE NOT NULL

    312	002212					    REPEAT THRU R0			; COPY ENTIRE FRAME

    313	002212						LET (R1)+ :B= (R5)+		; ONE CHARACTER AT A TIME

    314	002214					    END;R

    315	002216					    IFB -1(R5) IS EQ THEN LET R1 := R1 -1 ; ADJUST TO REAL LINE LENGTH

    316	002226					END;IF

    317	002226					LET FRMPTR	:= R5			; UPDATE FRAME POINTER

    318	002232					LET MACL	:= TRUE			; MACRO LINE IS PRESENT

    319	002240					LET MACLN	:= R1 - #MACLBF		; REAL LENGTH

    320	002252					RETURN

    321

    322

    323	002254				DMPMAC:

    324	002254					CALL WRTLST				; OUTPUT CURRENT LINE

    325	002260					LET R1		:= #MACLBF		; POINT TO MACRO LINE

    326	002264					LET R2		:= #LINEBF		; POINT TO LINE BUFFER

    327	002270					LET R0		:= MACLN -1		; GET LINE LENGTH

    328	002276					LET LINELN 	:= R0			; SAVE LENGTH

    329	002302					IF RESULT IS GT THEN			; LINE NOT NULL?

    330	002304					    REPEAT THRU R0			; COPY LINE

    331	002304						LET (R2)+ :B= (R1)+

    332	002306					    END;R

    333	002310					END;IF

    334	002310					LET MACLGT	:= TRUE			; TREAT AS A MACRO LINE

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 37-1

MISCELLANEOUS ROUTINES



    335	002316					RETURN					;

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 38

ERROR PROCESSING



    337					.SBTTL	ERROR PROCESSING

    338					;

    339					; WHEN AN ERROR HAPPENS, THIS ROUTINE IS CALLED TO PLACE

    340					; THE ERROR MESSAGE INTO THE LISTING FILE.

    341					;

    342	002320				P.WRN::					; WARNING MESSAGE

    343	002320	012767 	000000G	000000G		MOV	#WRNMSG,WRNERR			; LOAD POINTER TO "WARNING"

    344	002326	005267 	000000G			INC	WARNCT				; COUNT WARNINGS

    345	002332				P.PRT::					; PRINT MESSAGE

    346	002332	005367 	000000G			DEC	ERRCT				; DON'T COUNT THESE AS ERRORS

    347	002336	000403 				BR	ERRCOM				; SKIP TO COMMON ENTRY POINT

    348	002340				P.ERR::					; ERROR MESSAGE

    349	002340	012767 	000000G	000000G		MOV	#ERRMSG,WRNERR			; LOAD POINTER TO "ERROR  "

    350	002346				ERRCOM:	SAVRG					; SAVE R1 - R3

    351	002352					LET R1		:= FREEPT		; POINT TO FREE CORE

    352	002356					LET R2		:= R1 + #10.		; CHECK ROOM

    353	002364					IF R2 LO FRIEND AND (R5) IS NE THEN	; DON'T FILL CORE WITH ERRORS

    354	002376					    IFB #R.SEQ EQ F.RTYP+VAXBLK THEN	; SOS FILE?

    355	002406						LET R3	:= F.SEQN+VAXBLK	; YES, GET LINE NUMBER

    356	002412					    ELSE

    357	002414						LET R3	:= LINENM - LINBAS	; GET LINE SEQUENCE NUMBER

    358	002424					    END

    359	002424					    LET R0	:= ERRLST

    360	002430					    IF R3 NE 2(R0) OR SRCPAG NE 4(R0) THEN ; LINE-PAGE NOT RECORDED

    361	002446						LET ERRLST	:= R1		; POINT TO NEW LINK

    362	002452						LET (R1)+	:= R0		; LINK REST OF CHAIN

    363	002454						LET (R1)+	:= R3		; SAVE LINE NUMBER

    364	002456						LET (R1)+	:= SRCPAG	; SAVE PAGE NUMBER

    365	002462						LET FREEPT	:= R1		; ALLOCATE LINK

    366	002466					    END

    367	002466					END

    368	002466					PUSH LISTLV				; PUSH LISTING LEVEL

    369	002472					LET LISTLV	:= #100.			; FORCE LINE PRINTING

    370	002500					LET ERRCT := ERRCT +1			; COUNT THE ERROR

    371	002504					IF LSTXST IS FALSE OR (R5) IS EQ THEN	; NO LISTING OR ".PRINT"?

    372	002516					    CALL WRTTTY				; WRITE TO TTY

    373	002522					END

    374	002522					CALL WRTLST				; WRITE CURRENT LINE TO LISTING FILE

    375	002526					LET R2		:= #LSTLND		; POINT TO START OF LINE

    376	002532				    IF (R5) IS NE THEN				; ANY MESSAGE?

    377	002536					LET (R2)+	:B= #'?			; FLAG THIS AS AN ERROR

    378	002542					LET (R2)+	:B= #'?			;

    379	002546					LET (R2)+	:B= #SPACE		;

    380	002552					LET R1	:= WRNERR			; POINT TO HEADER

    381	002556					WHILEB (R1) IS NE			; COPY HEADER (WARNING/ERROR)

    382	002562					    LET (R2)+	:B= (R1)+

    383	002564					END

    384	002566					LET (R2)+	:B= #SPACE		;

    385	002572					LET R1		:= (R5)+		; PICK UP ERROR MESSAGE

    386	002574					LET R1		:= R1 + #ERRTBL		; POINT TO MESSAGE TEXT

    387	002600					WHILEB (R1) IS NE			; COPY MESSAGE TEXT

    388	002604					    LET (R2)+	:B= (R1)+		;

    389	002606					END

    390	002610					LET R1		:= (R5) -1		; POINT TO ERROR

    391	002614					WHILE R2 LO R1				; NOT TO ERROR YET

    392	002620					    IFB (R2)+ NE #TAB THEN		; LEAVE TABS ALONE

    393	002626						LET -1(R2) :B= #SPACE		; FILL WITH SPACES OTHERWISE

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 38-1

ERROR PROCESSING



    394	002634					    END					;

    395	002634					END;W					;

    396	002636					LET (R2)+	:B= #'!			; THIS IS WHERE IT'S AT

    397	002642				    END

    398	002642					LET LINELN	:= R2 - #LINEBF		; LENGTH OF LINE

    399	002654					IF LSTXST IS FALSE OR R1 IS EQ THEN	; LISTING FILE?

    400	002666					    CALL WRTTTY				; NO, SO LIST ON TTY

    401	002672					END

    402	002672					IF R1 IS NE				; ONLY IF REALLY ERROR

    403	002676					    CALL WRTLST				; WRITE OUT ERROR LINE

    404	002702					END

    405	002702					POP LISTLV				; RESTORE LISTING LEVEL

    406	002706					RETURN					;

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 39

DECIMAL OUTPUT ROUTINE



    408					.SBTTL	DECIMAL OUTPUT ROUTINE

    409					;

    410					;	DECOUT -- OUTPUT 5 DECIMAL DIGITS TO LISTING

    411					;

    412					; THE NUMBER TO PRINT IS IN R3.  R2 IS DESTROYED.

    413					;

    414					;

    415

    416	002710				PROCEDURE	DECOUT

    417

    418	002710					LET R2		:= 0			; CLEAR FOR DIVIDE

    419	002712	071227 	000012 			DIV		#10.,R2			; GET UNITS DIGIT

    420	002716					LET R0		:= R3 + #'0		; MAKE ASCII

    421	002724					CALL LSTCHAR				; OUTPUT IT

    422	002730					IF R2 IS EQ THEN RETURN			; ALL DONE

    423	002736					LET R3		:= R2			; GET QUOTIENT

    424	002740					LET R2		:= 0

    425	002742	071227 	000012 			DIV		#10.,R2			; GET TENS DIGIT

    426	002746					LET R0		:= R3 + #'0		; MAKE ASCII

    427	002754					CALL LSTCHAR				; OUTPUT IT

    428	002760					IF R2 IS EQ THEN RETURN

    429	002766					LET R3		:= R2

    430	002770					LET R2		:= 0

    431	002772	071227 	000012 			DIV		#10.,R2			; GET HUNDREDS DIGIT

    432	002776					LET R0		:= R3 + #'0

    433	003004					CALL LSTCHAR				; PRINT IT

    434	003010					IF R2 IS EQ THEN RETURN

    435	003016					LET R3		:= R2

    436	003020					LET R2		:= 0

    437	003022	071227 	000012 			DIV		#10.,R2			; GET THOUSANDS DIGIT

    438	003026					LET R0		:= R3 + #'0		; PRINT IT

    439	003034					CALL		LSTCHAR

    440	003040					IF R2 IS EQ THEN RETURN			; ALL DONE

    441	003046					LET R0		:= R2 + #'0		; GET TEN THOUSANDS DIGIT

    442	003054					CALL LSTCHAR				; PRINT IT

    443

    444	003060				ENDPROCEDURE	DECOUT

    445

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 40

PROGRAM COUNTER CONTROL



    447					.SBTTL	PROGRAM COUNTER CONTROL

    448					;

    449					; THESE ROUTINES CONTROL THE USE OF THE PROGRAM COUNTER SYMBOL (DOT).

    450					;

    451					;

    452	003062				P.STKPC::				; STACK CURRENT PC

    453	003062					GEN	STPBL				; STACK PSECT BASE + OFFSET

    454	003072					DATA	PSTNUM				; SEGMENT NUMBER

    455	003104					DATA	PC1				; CURRENT PC

    456	003116					DATA	PC1+1

    457	003130					DATA	PC2

    458	003142					DATA	PC2+1

    459	003154					LPUSH	PC1,PC2				; STACK CURRENT PC

    460	003174					RETURN

    461

    462	003176				P.AUGPC::				; AUGMENT PC

    463	003176					CALL	SETPC				; RECORD CURRENT PC

    464	003202					LET PC1		:= PC1 + (R5)		; INCREMENT PC

    465	003206	005567 	000000G			ADC PC2

    466	003212					LET PC2		:= PC2 + 2(R5)

    467	003220					LET R0		:= PSECTP		; POINT TO PSECT

    468	003224					IF #FP.REL SET.IN PSECOP(R0) THEN	; RELOCATABLE PSECT?

    469	003234					    GEN	AUGRB				; AUGMENT RELOCATION BASE

    470	003244					    DATA	(R5)+			; LONGWORD INCREMENT

    471	003254					    DATA	(R5)+

    472	003264					    DATA	(R5)+

    473	003274					    DATA	(R5)+

    474	003304					END

    475	003304					CALL	SETPC				; CHECK PC

    476	003310					RETURN

    477

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 41

ENTRY POINT DEFINITION



    479					.SBTTL	ENTRY POINT DEFINITION

    480					;

    481					; THIS ROUTINE OUTPUTS AN ENTRY POINT GSD TYPE.

    482					;

    483

    484	003312				P.EPT::					; ENTRY POINT DEFINITION

    485	003312					LET RECTYP	:= #OB.GSD		; OUTPUT A GSD RECORD

    486	003320					CALL WRTOBJ				; WRITE OUT PREVIOUS RECORD

    487	003324					LET R1		:= (R5)+		; GET NAME

    488	003326					DATA	#GS.EPT				; ENTRY POINT GSD

    489	003340					DATA	#0				; DATA TYPE

    490	003350					LET R2		:= #FS.DEF		; CLEAR FLAGS

    491	003354					IF #S.ABS OFF.IN SYMFLAGS(R1) THEN LET R2 := R2 SET.BY #FS.REL

    492	003370					IF #S.WEAK SET.IN SYMFLAGS(R1) THEN LET R2 := R2 SET.BY #FS.WK

    493	003404					DATA R2					; FLAGS (FIRST BYTE)

    494	003414					DATA #0					; FLAGS (SECOND BYTE)

    495	003424					DATA SYMSEG(R1)				; PSECTION

    496	003436					DATA SYMVL1(R1)				; VALUE

    497	003450					DATA SYMVL1+1(R1)

    498	003462					DATA SYMVL2(R1)

    499	003474					DATA SYMVL2+1(R1)

    500	003506					DATA (R5)				; ENTRY POINT MASK

    501	003516					DATA 1(R5)

    502	003530					CALL OBJNAM				; WRITE OUT NAME

    503	003534					CALL WRTOBJ				; WRITE OUT RECORD

    504	003540					LET RECTYP	:= #OB.TIR		; NEXT RECORD IS A TIR

    505	003546					RETURN					; AND EXIT

    506

    507

    508

    509	003550				P.STKEPT::				; STACK ENTRY POINT

    510

    511	003550					DATA	#STAEPM				; STACK ENTRY POINT MASK

    512	003562					LET R1		:= (R5)+		; GET SYMBOL POINTER

    513	003564					CALL	OBJNAM				; WRITE TO OBJECT CODE

    514	003570					LPUSH	#0,#0				; WE DON'T KNOW WHAT IT WAS

    515	003610					RETURN					; AND EXIT

    516

    517		000001 			.END

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 41-1

SYMBOL TABLE



AUGRB = ****** GX	LBLS0 = 000064   	L44     002516R     002	P.FLAG  001724RG    002	SYMLIN= 000000

A3    = 000000   	LBLS1 = 000054   	L45     002522R     002	P.FNEW  001706RG    002	SYMMAX= 000017

BCHK  = ****** GX	LBLS2 = 000014   	L46     002642R     002	P.MACL  002170RG    002	SYMSEG= 000010

BLNK  = 000040   	LBLS3 = 000052   	L47     002566R     002	P.NEWL  001700RG    002	SYMVL1= 000004

BLNKP = ****** GX	LF    = 000012   	L5      000326R     002	P.NEWP  001102RG    002	SYMVL2= 000006

B0      000276R     002	LFORM = ****** GX	L50     002610R     002	P.PRIL  001042RG    002	S.ABS = 004000

B1      000414R     002	LFTANG= 000074   	L51     002636R     002	P.PRT   002332RG    002	S.ASN = 000200

B10     002212R     002	LINBAS= ****** GX	L52     002634R     002	P.PSEC  001302RG    002	S.DBG = 002000

B11     002304R     002	LINEBF= ****** GX	L53     002666R     002	P.REST  001326RG    002	S.DF  = 100000

B12     002556R     002	LINELN= ****** GX	L54     002672R     002	P.SAVE  001652RG    002	S.EPT = 000100

B13     002600R     002	LINENM= ****** GX	L55     002702R     002	P.SBTT  001776RG    002	S.EXTN= 010000

B14     002614R     002	LISTIT= ****** GX	L56     002736R     002	P.SPID  000110RG    002	S.GLOB= 020000

B2      000532R     002	LISTLV= ****** GX	L57     002766R     002	P.STIB  000604RG    002	S.LOCL= 001000

B3      001240R     002	LOWCAS= 000140   	L6      000464R     002	P.STIL  000746RG    002	S.ODBG= 000040

B4      001476R     002	LPTLEN= 000074   	L60     003016R     002	P.STIW  000662RG    002	S.REF = 000400

B5      002016R     002	LSTCHA= ****** GX	L61     003046R     002	P.STKE  003550RG    002	S.TKMS= 000377

B6      002026R     002	LSTLCT= ****** GX	L62     003304R     002	P.STKP  003062RG    002	S.WEAK= 040000

B7      002062R     002	LSTLIN= ****** GX	L63     003370R     002	P.STOL  000122RG    002	TAB   = 000011

COMMA = 000054   	LSTLND= ****** GX	L64     003404R     002	P.STOV  000166RG    002	TYPS0 = 000000

CR    = 000015   	LSTLPT= ****** GX	L7      000444R     002	P.STRB  000232RG    002	TYPS1 = 000000

DECOUT  002710RG    002	LSTXST= ****** GX	MACL  = ****** GX	P.STRL  000466RG    002	TYPS2 = 000001

DMPMAC  002254R     002	L0      000024R     002	MACLBF= ****** GX	P.STRW  000350RG    002	TYPS3 = 000000

ERRCOM  002346R     002	L1      000070R     002	MACLGT= ****** GX	P.STSB  000000RG    002	VAXBLK= ****** GX

ERRCT = ****** GX	L10     000602R     002	MACLN = ****** GX	P.STSW  000044RG    002	V1STAC= ****** GX

ERRLST= ****** GX	L11     000562R     002	MEBLST= ****** GX	P.WRN   002320RG    002	V2STAC= ****** GX

ERRMSG= ****** GX	L12     000620R     002	M.ARGC= 000014   	P2LINE= ****** GX	WARNCT= ****** GX

ERRTBL= ****** GX	L13     000676R     002	M.ARGS= 000016   	RECTYP= ****** GX	WCHK  = ****** GX

E0      000346R     002	L14     000762R     002	M.END = 000012   	RGTANG= 000076   	WRNERR= ****** GX

E1      000464R     002	L15     001226R     002	M.GETL= 000004   	RTNVAL=%000000   	WRNMSG= ****** GX

E10     002216R     002	L16     001450R     002	M.IFLV= 000006   	R.SEQ = ****** GX	WRTLST= ****** GX

E11     002310R     002	L17     001450R     002	M.IFVL= 000010   	R6    =%000006   	WRTOBJ= ****** GX

E12     002566R     002	L2      000146R     002	M.LINK= 000000   	R7    =%000007   	WRTTTY= ****** GX

E13     002610R     002	L20     001626R     002	M.NXTL= 000002   	SBTLB2= ****** GX	$DIDDO= 000000

E14     002636R     002	L21     001650R     002	OBJBYT= ****** GX	SEMI  = 000073   	$E$   = 000001

E2      000602R     002	L22     001766R     002	OBJNAM= ****** GX	SETPC = ****** GX	$F$   = 000000

E3      001252R     002	L23     001774R     002	OBJPSC= ****** GX	SETRB = ****** GX	$I$   = 000001

E4      001510R     002	L24     002022R     002	OB.GSD= ****** GX	SPACE = 000040   	$L    = 000015

E5      002022R     002	L25     002034R     002	OB.TIR= ****** GX	SRCPAG= ****** GX	$LL   = 000013

E6      002034R     002	L26     002056R     002	OUTOBJ= ****** GX	STAEPM= ****** GX	$L$   = 000000

E7      002164R     002	L27     002166R     002	PC1   = ****** GX	STOB  = ****** GX	$O$   = 000000

FF    = 000014   	L3      000212R     002	PC2   = ****** GX	STOIM = ****** GX	$R    = 177777

FP.REL= ****** GX	L30     002164R     002	PLONG   000132R     002	STOL  = ****** GX	$SV$  = 000000

FREEPT= ****** GX	L31     002142R     002	PSCRES  001350R     002	STOPID= ****** GX	$T    = 000065

FRIEND= ****** GX	L32     002152R     002	PSECCH= 000020   	STORB = ****** GX	$T1   = 000000

FRMPTR= ****** GX	L33     002202R     002	PSECOP= 000016   	STORL = ****** GX	$T2   = 000062

FS.DEF= ****** GX	L34     002226R     002	PSECTP= ****** GX	STORW = ****** GX	$Y$   = 000000

FS.REL= ****** GX	L35     002226R     002	PSECV1= 000012   	STOV  = ****** GX	$Z$   = 000000

FS.WK = ****** GX	L36     002310R     002	PSECV2= 000014   	STOW  = ****** GX	$$S   = 000000

F.RTYP= ****** GX	L37     002466R     002	PSTNUM= ****** GX	STPBB = ****** GX	$$T   = 000064

F.SEQN= ****** GX	L4      000346R     002	P.ASN   001734RG    002	STPBL = ****** GX	$$TT  = 000054

GETLIN= ****** GX	L40     002414R     002	P.AUGP  003176RG    002	STPBW = ****** GX	.GEN  = ****** GX

GS.EPT= ****** GX	L41     002424R     002	P.CHKL  002036RG    002	SYMCHR= 000012   	.SAVRG= ****** GX

GS.PDF= ****** GX	L42     002446R     002	P.EPT   003312RG    002	SYMFLA= 000002   	.$T   = 000001

IIII  = 177777   	L43     002466R     002	P.ERR   002340RG    002	SYMLEN= 000011



. ABS.	000000	   000

      	000000	   001

P2ACT2	PASS 2 ACTION ROUTINES	MACRO M1110  21-AUG-78 23:11  PAGE 41-2

SYMBOL TABLE



P2ACT2	003612	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  12798 WORDS  ( 50 PAGES)

DYNAMIC MEMORY:  14388 WORDS  ( 55 PAGES)

ELAPSED TIME:  00:05:40

OBJ$:P2ACT2,LIS$:P2ACT2/-SP=SRC$:MD,COMMON,P2ACT2

