.MAIN.	MACRO M1110  21-AUG-78 23:02

TABLE OF CONTENTS



    32-    2	INTERMEDIATE CODE DEFINITIONS

    33-   39	INTERMEDIATE OPCODE DISPATCH TABLE

    34-   99	OBJECT CODE DEFINITIONS

    35-  141	TEXT/INFORMATION RECORD COMMANDS

    36-    3	**********  INTERMEDIATE CODE INTERPRETATION  **********

    36-    4	PASS TWO DRIVER ROUTINE

    37-   45	OUTPUT MODULE HEADER TO OBJECT FILE

    38-   86	OUTPUT SUB-HEADER RECORDS TO OBJECT FILE

    39-  134	OUTPUT GLOBAL SYMBOL DIRECTORY TO OBJECT FILE

    40-  185	PASS 2 DRIVER LOOP

P2DRVR	MACRO M1110  21-AUG-78 23:02  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$

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 32





      1					.IIF DF $DATA$, .NLIST

      2					.SBTTL	INTERMEDIATE CODE DEFINITIONS

      3					;

      4					;

      5					; PASS 1 OF THE ASSEMBLER GENERATES AN INTERMEDIATE CODE FILE

      6					; WHICH IS PROCESSED BY PASS 2 TO PRODUCE THE OBJECT FILE.

      7					; THE INTERMEDIATE CODE HAS THE FOLLOWING FORMAT:

      8					;

      9					;	*****************

     10					;	*    LENGTH	*	LENGTH IN BYTES OF THIS FRAME

     11					;	*****************	1 BYTE

     12					;	*    ACTION	*	ACTION TO PERFORM (SEE CODES BELOW)

     13					;	*****************	1 BYTE

     14					;	*		*

     15					;	*     DATA	*	DATA ASSOCIATED WITH FRAME

     16					;	*		*

     17					;	*****************	VARIALBE LENGTH

     18					;

     19					;

     20					;

     21					; THE MACRO BELOW DEFINES THE ACTION CODES, AND GENERATES A BRANCH TABLE.

     22					;

     23

     24		000000 			$COUNT	= 0			; START ACTION COUNTER AT ZERO

     25

     26

     27					.MACRO	INT SYM			; ARGUMENT IS SYMBOL NAME

     28					.IF DF $DATA$

     29						I.'SYM == $COUNT	; ASSIGN GLOBAL VALUE TO SYMBOL

     30					.IFF

     31						.WORD P.'SYM		; ADDRESS OF PASS 2 ACTION ROUTINE

     32					.IFTF

     33						.LIST

     34											$COUNT = $COUNT + 1

     35						.NLIST

     36					.ENDC

     37					.ENDM

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 33

INTERMEDIATE OPCODE DISPATCH TABLE



     39					.SBTTL	INTERMEDIATE OPCODE DISPATCH TABLE

     40					.IF NDF $DATA$

     41	000000				.PSECT	P2ITAB,D,GBL

     42	000000				P2TAB::				; START OF PASS 2 BRANCH TABLE

     43					.ENDC

     44

     45	000000				INT	ILG	; ILLEGAL INTERMEDIATE CODE (0)

		000001 									$COUNT = $COUNT + 1

     46	000002				INT	ADD	; ADD TOP TWO ITEMS ON STACK

		000002 									$COUNT = $COUNT + 1

     47	000004				INT	AND	; LOGICAL AND

		000003 									$COUNT = $COUNT + 1

     48	000006				INT	ASH	; ASH

		000004 									$COUNT = $COUNT + 1

     49	000010				INT	ASN	; ASSIGNMENT

		000005 									$COUNT = $COUNT + 1

     50	000012				INT	AUGPC	; AUGMENT PC

		000006 									$COUNT = $COUNT + 1

     51	000014				INT	BDST	; GENERATE BRANCH DESTINATION

		000007 									$COUNT = $COUNT + 1

     52	000016				INT	CHKL	; ALLIGN OUTPUT WITH SOURCE LINES

		000010 									$COUNT = $COUNT + 1

     53	000020				INT	DIV	; DIVIDE

		000011 									$COUNT = $COUNT + 1

     54	000022				INT	END	; END OF INTERMEDIATE CODE

		000012 									$COUNT = $COUNT + 1

     55	000024				INT	EPT	; ENTRY POINT DEFINITION

		000013 									$COUNT = $COUNT + 1

     56	000026				INT	ERR	; PASS 1 ERROR MESSAGE

		000014 									$COUNT = $COUNT + 1

     57	000030				INT	FLAG	; SET FLAG

		000015 									$COUNT = $COUNT + 1

     58	000032				INT	FNEWL	; FORCE NEW LISTING LINE

		000016 									$COUNT = $COUNT + 1

     59	000034				INT	LGLAB	; STANDARD (NOT LOCAL) LABEL

		000017 									$COUNT = $COUNT + 1

     60	000036				INT	MACL	; MACRO TEXT LINE

		000020 									$COUNT = $COUNT + 1

     61	000040				INT	MUL	; MULTIPLY

		000021 									$COUNT = $COUNT + 1

     62	000042				INT	NEG	; NEGATE

		000022 									$COUNT = $COUNT + 1

     63	000044				INT	NEWL	; NEW LINE OF SOURCE TEXT

		000023 									$COUNT = $COUNT + 1

     64	000046				INT	NEWP	; DEFINE NEW PSECT

		000024 									$COUNT = $COUNT + 1

     65	000050				INT	NOT	; LOGICAL NOT

		000025 									$COUNT = $COUNT + 1

     66	000052				INT	OP	; GENERATE OPCODE

		000026 									$COUNT = $COUNT + 1

     67	000054				INT	OR	; LOGICAL OR

		000027 									$COUNT = $COUNT + 1

     68	000056				INT	PRIL	; PRINT LONG WORD IN LISTING

		000030 									$COUNT = $COUNT + 1

     69	000060				INT	PRT	; PASS 1 PRINT DIRECTIVE

		000031 									$COUNT = $COUNT + 1

     70	000062				INT	PSECT	; CHANGE PSECT

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 33-1

INTERMEDIATE OPCODE DISPATCH TABLE



		000032 									$COUNT = $COUNT + 1

     71	000064				INT	REF	; GENERATE REFERENCE

		000033 									$COUNT = $COUNT + 1

     72	000066				INT 	REST	; RESTORE PSECT

		000034 									$COUNT = $COUNT + 1

     73	000070				INT	SAME	; UNARY PLUS

		000035 									$COUNT = $COUNT + 1

     74	000072				INT	SAVE	; SAVE PSECT

		000036 									$COUNT = $COUNT + 1

     75	000074				INT	SBTTL	; SUBTITLE

		000037 									$COUNT = $COUNT + 1

     76	000076				INT	SPIC	; STORE POSITION INDEPENDENT

		000040 									$COUNT = $COUNT + 1

     77	000100				INT	SPID	; STORE ADDRESS

		000041 									$COUNT = $COUNT + 1

     78	000102				INT	STIB	; STORE IMMEDIATE BYTE

		000042 									$COUNT = $COUNT + 1

     79	000104				INT	STIW	; STORE IMMEDIATE WORD

		000043 									$COUNT = $COUNT + 1

     80	000106				INT	STIL	; STORE IMMEDIATE LONGWORD

		000044 									$COUNT = $COUNT + 1

     81	000110				INT	STKEPT	; STACK ENTRY POINT

		000045 									$COUNT = $COUNT + 1

     82	000112				INT	STKG	; STACK GLOBAL SYMBOL

		000046 									$COUNT = $COUNT + 1

     83	000114				INT	STKL	; STACK LITERAL VALUE

		000047 									$COUNT = $COUNT + 1

     84	000116				INT	STKPC	; STACK CURRENT PC

		000050 									$COUNT = $COUNT + 1

     85	000120				INT	STKS	; STACK SYMBOL

		000051 									$COUNT = $COUNT + 1

     86	000122				INT	STOL	; STORE LONG WORD

		000052 									$COUNT = $COUNT + 1

     87	000124				INT	STRB	; STORE REPEATED BYTE

		000053 									$COUNT = $COUNT + 1

     88	000126				INT	STRW	; STORE REPEATED WORD

		000054 									$COUNT = $COUNT + 1

     89	000130				INT	STRL	; STORE REPEATED LONG

		000055 									$COUNT = $COUNT + 1

     90	000132				INT	STSB	; STORE SIGNED BYTE

		000056 									$COUNT = $COUNT + 1

     91	000134				INT	STSW	; STORE SIGNED WORD

		000057 									$COUNT = $COUNT + 1

     92	000136				INT	SUB	; SUBTRACT

		000060 									$COUNT = $COUNT + 1

     93	000140				INT	WRN	; PASS 1 WARNING MESSAGE

		000061 									$COUNT = $COUNT + 1

     94	000142				INT	XOR	; EXCLUSIVE OR

		000062 									$COUNT = $COUNT + 1

     95	000144				INT	RDEF	; REDEFINE ADDRESS (.TRANSFER)

		000063 									$COUNT = $COUNT + 1

     96

     97		000063 			.IIF NDF $DATA$, MAXP2C	= $COUNT	; MAX CODE ASSIGNED

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 34

OBJECT CODE DEFINITIONS



     99					.SBTTL	OBJECT CODE DEFINITIONS

    100					.IF NDF $DATA$	; DON'T ASSEMBLE IF DATA FILE

    101

    102					;

    103					; THESE EQUATES SYMBOLS ARE THE OBJECT MODULE RECORD HEADER, SUBHEADER,

    104					; AND FLAG DEFINITIONS.  THEY ARE USED BY THE PASS 2 ACTION ROUTINES.

    105					;

    106

    107		000000 			OB.MHD	==	0			; MODULE HEADER RECORD

    108		000000 				HD.MHD	==	0		;	MODULE HEADER

    109		000001 				HD.MRS	==	1		;	LANGUAGE PROCESSOR

    110		000002 				HD.INP	==	2		;	COMMAND LINE TYPED

    111		000003 				HD.TIT	==	3		;	TITLE TEXT

    112		000004 				HD.CPY	==	4		;	COPYRIGHT STATEMENT

    113		000005 				HD.STS	==	5		;	MAINTENANCE STATUS

    114		000001 			OB.GSD	==	1			; GLOBAL SYMBOL DIRECTORY RECORD

    115		000000 			    GS.PDF	==	0		;    PSECT DEFINITION

    116		000001 				FP.PIC	==	001		;	POSITION INDEPENDENT

    117		000002 				FP.UNI	==	002		;	UNIVERSAL

    118		000004 				FP.OVL	==	004		;	OVERLAID

    119		000010 				FP.REL	==	010		;	RELOCATION REQUIRED

    120		000020 				FP.GBL	==	020		;	GLOBAL

    121		000040 				FP.SHR	==	040		;	SHAREABLE

    122		000100 				FP.XEQ	==	100		;	EXECUTABLE

    123		000200 				FP.RD	==	200		;	READ

    124		000400 				FP.WRT	==	400		;	WRITE

    125		000001 			    GS.SDF	==	1		;    SYMBOL DEFINITION

    126		000001 				FS.WK	==	001		;	WEAK RESOLUTION

    127		000002 				FS.DEF	==	002		;	DEFINITION

    128		000004 				FS.UNI	==	004		;	UNIVERSAL

    129		000010 				FS.REL	==	010		;	RELATIVE

    130		000020 				FS.VAL	==	020		;	VALIDATE

    131		000002 			    GS.EPT	==	2		;    ENTRY POINT DEFINITION

    132		000002 			OB.TIR	==	2			; TEXT INFORMATION RECORD

    133		000003 			OB.EOM	==	3			; END OF MODULE RECORD

    134		000000 				ER.OK	==	0		;	NO ERRORS

    135		000001 				ER.WRN	==	1		;	WARNINGS

    136		000002 				ER.ERR	==	2		;	SERIOUS ERRORS

    137		000003 				ER.CRP	==	3		;	ABORT LINK

    138		000004 			OB.DBG	==	4			; DEBUGGER INFORMATION RECORD

    139		000005 			OB.TRC	==	5			; TRACEBACK INFORMATION RECORD

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 35

TEXT/INFORMATION RECORD COMMANDS



    141					.SBTTL	TEXT/INFORMATION RECORD COMMANDS

    142					;

    143		000000 			STAG	==	0	; STACK GLOBAL

    144		000001 			STASB	==	1.	; STACK SIGNED BYTE

    145		000002 			STASW	==	2.	; STACK SIGNEW WORD

    146		000003 			STAL	==	3.	; STACK LONG WORD

    147		000004 			STPBB	==	4.	; STACK PSECT BASE + BYTE

    148		000005 			STPBW	==	5.	; STACK PSECT BASE + WORD

    149		000006 			STPBL	==	6.	; STACK PSECT BASE + LONG WORD

    150		000007 			STAUSB	==	7.	; STACK UNSIGNED BYTE

    151		000010 			STAUSW	==	8.	; STACK UNSIGNED WORD

    152		000011 			STABFI	==	9.	; STACK BYTE FROM IMAGE

    153		000012 			STAWFI	==	10.	; STACK WORD FROM IMAGE

    154		000013 			STALFI	==	11.	; STACK LONGWORD FROM IMAGE

    155		000014 			STAEPM	==	12.	; STACK ENTRY POINT MASK

    156		000024 			STOSB	==	20.	; STORE SIGNED BYTE

    157		000025 			STOSW	==	21.	; STORE SIGNED WORD

    158		000026 			STOL	==	22.	; STORE LONG WORD

    159		000027 			STOBD	==	23.	; STORE BYTE DISPLACED

    160		000030 			STOWD	==	24.	; STORE WORD DISPLACED

    161		000031 			STOLD	==	25.	; STORE LONG WORD DISPLACED

    162		000032 			STOLI	==	26.	; STORE SHORT LITERAL

    163		000033 			STOPIDR ==	27.	; STORE POSITION INDEPENDENT DATA REFERENCE

    164		000034 			STOPICR	==	28.	; STORE POSITION INDEPENDENT CODE REFERENCE

    165		000035 			STORSB	==	29.	; STORE REPEATED SIGNED BYTE

    166		000036 			STORSW	==	30.	; STORE REPEATED SIGNED WORD

    167		000037 			STORL	==	31.	; STORE REPEATED LONGWORD

    168		000040 			STOV	==	32.	; STORE BIT FIELD

    169		000041 			STOUSB	==	33.	; STORE UNSIGNED BYTE

    170		000042 			STOUSW	==	34.	; STORE UNSIGNED WORD

    171		000043 			STORUB	==	35.	; STORE REPEATED UNSIGNED BYTE

    172		000044 			STORUW	==	36.	; STORE REPEATED UNSIGNED WORD

    173		000045 			STOB	==	37.	; STORE AMBIGUOUS BYTE

    174		000046 			STOW	==	38.	; STORE WORD

    175		000047 			STORB	==	39.	; STORE REPEATED BYTE

    176		000050 			STORW	==	40.	; STORE REPEATED WORD

    177		000062 			L.NOP	==	50.	; NEGATE OR POSITIVIZE

    178		000063 			L.ADD	==	51.	; ADD TOP TWO ELEMENTS ON STACK

    179		000064 			L.SUB	==	52.	; SUBTRACT

    180		000065 			L.MUL	==	53.	; MULTIPLY

    181		000066 			L.DIV	==	54.	; DIVIDE

    182		000067 			L.AND	==	55.	; AND

    183		000070 			L.OR	==	56.	; INCLUSIVE OR

    184		000071 			L.EOR	==	57.	; EXCLUSIVE OR

    185		000072 			L.NEG	==	58.	; NEGATE

    186		000073 			L.COM	==	59.	; COMPLEMENT

    187		000074 			L.INSV	==	60.	; INSERT VARIABLE FIELD

    188		000075 			L.ASH	==	61.	; ASH

    189		000076 			L.USH	==	62.	; UNSIGNED (LOGICAL) SHIFT

    190		000077 			L.ROT	==	63.	; ROTATE

    191		000101 			REDEF	==	65.	; REDEFINE SYMBOL VALUE (.TRANSFER)

    192		000120 			SETRB	==	80.	; SET RELOCATION BASE

    193		000121 			AUGRB	==	81.	; AUGMENT RELOCATION BASE

    194

    195					.ENDC

    196					.IIF DF $DATA$, .LIST

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 36

TEXT/INFORMATION RECORD COMMANDS



      1					.TITLE P2DRVR

      2	000000				.PSECT P2DRVR

      3					.SBTTL	**********  INTERMEDIATE CODE INTERPRETATION  **********

      4					.SBTTL	PASS TWO DRIVER ROUTINE

      5		000001 			$P2$ = 1					; THIS IS PASS 2

      6					;++

      7					;	PASS 2 DRIVER ROUTINE

      8					;

      9					; THIS ROUTINE DRIVES PASS 2 BY READING INTERMEDIATE CODE BLOCKS

     10					; AND CALLING TO THE ROUTINES TO HANDLE THE BLOCK TYPE.

     11					;

     12					;--

     13

     14	000000				P2DRVR::

     15

     16	000000					LET P2		:= TRUE			; THIS IS PASS 2

     17	000006					LET R4		:= 0			; RESET STACK POINTER

     18	000010					LET OBJPTR	:= #OBJBUF		; INITIALIZE OBJECT CODE FILE

     19	000016					LET P2LINE	:= 0			; PASS2 LINE NO. IS 0

     20	000022					LET LINENM	:= 0			;

     21	000026					LET ERRLST	:= 0			; NO ERROR LINES YET

     22	000032					LET MACLGT	:= FALSE		; DON'T HAVE MACRO LINE

     23	000036					CALL HEDSET				; SET UP THE HEADER

     24	000042					PUSH LISTLV				; SAVE LISTING LEVEL

     25	000046					LET LISTLV	:= #-1			; PREVENT LISTING

     26	000054					CALL WRTLST				; INITIALIZE LISTING BUFFER

     27	000060					POP LISTLV				; RESTORE LISTING LEVEL

     28	000064					LET NEWPND	:= TRUE			; NEW PAGE IS PENDING

     29	000072					LET PSECTP	:= #MAIN		; RESET TO ABSOLUTE PSECT

     30	000100					LET PC1		:= 0			; CLEAR PC

     31	000104					LET PC2		:= 0			;

     32					;

     33					; RESET SOURCE FILE AND INTERMEDIATE CODE FILE

     34					;

     35	000110					CALL GETLIN				; GET FIRST LINE

     36	000114					LET R3		:= #1			; START WITH LINE 1

     37	000120					LET LSTLPT	:= #LSTLIN-1		; SET PTR FOR LINE NUMBER

     38	000126					IFB #R.SEQ EQ F.RTYP+VAXBLK THEN	; "SOS" FILE?

     39	000136					    LET R3	:= F.SEQN+VAXBLK	; GET "SOS" LINE NUMBER

     40	000142					END;IF

     41	000142					CALL DECOUT				; OUTPUT LINE NUMBER

     42	000146					LET FRMTOP	:= 0			; FORCE READ OF FIRST BUFFER

     43	000152					LET FRMPTR	:= #FRMBUF		; INITIALIZE INTERMEDIATE CODE FILE

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 37

OUTPUT MODULE HEADER TO OBJECT FILE



     45					.SBTTL	OUTPUT MODULE HEADER TO OBJECT FILE

     46

     47	000160					LET R1		:= #OBJBUF		; POINT TO OBJECT CODE BUFFER

     48	000164					LET (R1)+	:B= #OB.MHD		; MODULE HEADER

     49	000170					LET (R1)+	:B= #HD.MHD		; MODULE HEADER

     50	000174					LET (R1)+	:B= #0			; STRUCTURE LEVEL

     51	000176					LET (R1)+	:B= #0			; RECORD SIZE IS 512 BYTES

     52	000200					LET (R1)+	:B= #2			; UPPER BYTE OF 512

     53	000204					IF TITLEP IS EQ THEN			; USE DEFAULT TITLE

     54	000212					    LET R2	:= #XTITLE		; ADDRESS OF COUNTED STRING

     55	000216					ELSE

     56	000220					    LET R2	:= TITLEP + #SYMLEN	; POINT TO TITLE

     57	000230					END;IF

     58	000230					LET R0		:B= (R2)+		; PICK UP LEN

     59	000232					LET (R1)+	:B= R0			; TO OBJ

     60	000234					REPEAT THRU R0				; COPY NAME

     61	000234					    LET (R1)+	:B= (R2)+

     62	000236					END

     63

     64	000240					LET R2		:= IDENTP		; POINT TO IDENT

     65	000244					IF RESULT IS EQ ORB (R2) IS EQ THEN	; IDENT IS NULL

     66	000252					    LET (R1)+	:B= #1			; FORCE VER TO 1 CHAR

     67	000256					    LET (R1)+	:B= #'0			; IDENT = 0

     68	000262					ELSE

     69	000264					    LET R0	:B= (R2)+		; LENGTH

     70	000266					    LET (R1)+	:B= R0			; COPY TO OBJ

     71	000270					    REPEAT THRU R0			; COPY IDENT

     72	000270						LET (R1)+ :B= (R2)+

     73	000272					    END;R

     74	000274					END;IF

     75	000274					LET R2		:= DATIPT		; POINT TO DATE/TIME

     76	000300					REPEAT THRU R0	:= #17.			; SIZE OF DATE / TIME

     77	000304					    LET (R1)+	:B= (R2)+

     78	000306					END

     79	000310					REPEAT THRU R0	:= #17.			; 17 CHARS

     80	000314					    LET (R1)+	:B= #BLNK		; BLANK FILL PATCH DATE

     81	000320					END

     82	000322					LET OBJPTR	:= R1			; SET HEADER SIZE

     83	000326					CALL WRTOBJ				; WRITE OUT THE HEADER

     84

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 38

OUTPUT SUB-HEADER RECORDS TO OBJECT FILE



     86					.SBTTL	OUTPUT SUB-HEADER RECORDS TO OBJECT FILE

     87					;+

     88					; SUB-HEADER RECORDS INCLUDE:

     89					;	LANGUAGE NAME

     90					;	VERSION NUMBER

     91					;	COMMAND LINE

     92					;	TITLE SUB-STRING

     93					;-

     94

     95	000332					LET R1		:= #OBJBUF		; POINT TO OBJ BUFFER

     96	000336					LET (R1)+	:B= #OB.MHD		; HEADER RECORD

     97	000342					LET (R1)+	:B= #HD.MRS		; LANGUAGE PROCESSOR NAME

     98	000346					LET R2		:= #VRSION		; CURRENT VERSION

     99	000352					LET R0		:B= (R2)+		; LENGTH OF NAME

    100	000354					REPEAT THRU R0				; COPY NAME

    101	000354					    LET (R1)+	:B= (R2)+

    102	000356					END

    103	000360					LET OBJPTR	:= R1			; SET LENGTH

    104	000364					CALL WRTOBJ				; WRITE RECORD

    105

    106	000370					LET R1		:= #OBJBUF		; POINT TO BUFFER

    107	000374					LET (R1)+	:B= #OB.MHD		; HEADER RECORD

    108	000400					LET (R1)+	:B= #HD.INP		; INPUT LINE

    109	000404					LET R2		:= CMLINE		; POINT TO LINE DESCRIPTOR

    110	000410					LET R0		:= (R2)+		; LENGTH

    111	000412					LET R2		:= (R2)			; PTR TO LINE

    112	000414					REPEAT THRU R0				; COPY LINE

    113	000414					    LET (R1)+	:B= (R2)+

    114	000416					END

    115	000420					LET OBJPTR	:= R1			; SET LENGTH

    116	000424					CALL WRTOBJ				; WRITE BUFFER

    117

    118	000430					LET R1		:= #OBJBUF		; POINT TO BUFFER

    119	000434					LET (R1)+	:B= #OB.MHD		; HEADER RECORD

    120	000440					LET (R1)+	:B= #HD.TIT		; TITLE TEXT

    121	000444					LET R2		:= TITTXT		; GET LENGTH OF TITLE TEXT

    122	000450					LET R0		:= #LPTHD2		; POINT TO TITLE TEXT

    123	000454					IF R2 IS GT THEN			; IT EXISTS

    124	000460					    REPEAT THRU R2			; COPY TEXT

    125	000460						LET (R1)+ :B= (R0)+

    126	000462					    END;R

    127	000464					ELSE

    128	000466					    LET (R1)+	:B= #1			; ELSE FAKE 1 CHAR

    129	000472					    LET (R1)+	:B= #BLNK		; (A SPACE)

    130	000476					END;IF

    131	000476					LET OBJPTR	:= R1			; SET LENGTH

    132

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 39

OUTPUT GLOBAL SYMBOL DIRECTORY TO OBJECT FILE



    134					.SBTTL	OUTPUT GLOBAL SYMBOL DIRECTORY TO OBJECT FILE

    135					;+

    136					;

    137					; GLOBAL SYMBOLS ARE WRITTEN OUT IN ALPHABETICAL ORDER, THE SYMBOL

    138					; FLAGS ARE SENT OUT WITH THE SYMBOL NAME.  IF THE SYMBOL IS DEFINED IN

    139					; THIS MODULE THE PSECT AND VALUE ARE ALSO WRITTEN OUT.

    140					;

    141					;-

    142

    143	000502				PUSH		R4				; SAVE R4

    144	000504				LET RECTYP	:= #OB.GSD			; THESE ARE GSD RECORDS

    145	000512				CALL WRTOBJ					; WRITE OUT HEADER

    146	000516				    LET R2	:= IDENTB			; GET SYMBOL POINTER

    147

    148	000522				    WHILE R2 IS NE				; NEXT SYMBOL IN CHAIN

    149	000526					IF EN.GBL+SYMVL2 IS NE THEN		; DEFAULT GBLS NOT DISABLED?

    150	000534					    IF #S.DF+S.LOCL+S.WEAK OFF.IN SYMFLAG(R2) THEN ; ORPHAN SYMBOL?

    151	000544						LET SYMFLAG(R2) := SYMFLAG(R2) SET.BY #S.EXTN ; EXTERNAL

    152	000552					    END;IF

    153	000552					END;IF

    154	000552					IF #S.GLOBL+S.EXTN SET.IN SYMFLAG(R2) AND #S.EPT+S.LOCL OFF.IN SYMFLAG(R2) THEN

    155											; IS SYMBOL GLOBAL OR EXTERNAL?

    156	000572					    DATA #GS.SDF			; GSD TYPE

    157	000604					    DATA #0				; DATA TYPE

    158	000614					    IF #S.DF SET.IN SYMFLAG(R2) THEN	; DEFINITION OR REF?

    159	000624						LET R1	:= #FS.DEF		; DEFINITION

    160	000630					    ELSE

    161	000632						LET R1	:= 0			; REFERENCE

    162	000634					    END;IF

    163	000634					    IF #S.ABS  OFF.IN SYMFLAG(R2) THEN LET R1 := R1 SET.BY #FS.REL

    164	000650					    IF #S.WEAK SET.IN SYMFLAG(R2) THEN LET R1 := R1 SET.BY #FS.WK

    165	000664					    DATA	R1			; FLAGS (FIRST BYTE)

    166	000674					    DATA	#0			; FLAGS (SECOND BYTE)

    167	000704					    IF #FS.DEF SET.IN R1 THEN		; ONLY FOR DEF

    168	000712						DATA SYMSEG(R2)			; PSECT INDEX

    169	000724						DATA SYMVL1(R2)			; VALUE

    170	000736						DATA SYMVL1+1(R2)

    171	000750						DATA SYMVL2(R2)

    172	000762						DATA SYMVL2+1(R2)

    173	000774					    END;IF

    174	000774					    LET R1	:= R2			; COPY BLOCK POINTER

    175	000776					    CALL OBJNAM				; COPY NAME TO BUFFER

    176	001002					    IF OBJPTR HIS #OBJBUF+485. THEN CALL WRTOBJ ; NOT ROOM FOR ANOTHER

    177	001016					END;IF

    178	001016					LET R2		:= (R2)			; POINT TO NEXT SYMBOL BLOCK

    179	001020				    END;W

    180

    181	001024				IF OBJPTR HI #OBJBUF+1 THEN CALL WRTOBJ		; FLUSH BUFFER CONTENTS

    182	001040				POP		R4				; RESTORE R4

    183	001042				LET RECTYP	:= #OB.TIR			; ASSUME TIR'S FROM NOW ON

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 40

PASS 2 DRIVER LOOP



    185					.SBTTL	PASS 2 DRIVER LOOP

    186					;+

    187					;

    188					; THE INTERMEDIATE FILE IS READ BY "GETFRAME", -1(R5) IS THE NEXT COMMAND

    189					; TO BE EXECUTED.  IF THE COMMAND NUMBER IS OUT OF RANGE "P.ILG" IS CALLED.

    190					; THE LOOP CONTINUES UNTIL "PARSE" IS SET FALSE, THIS IS DONE BY "P.END".

    191					;

    192					;-

    193	001050					LET PARSE	:= TRUE			; START PASS-2 DRIVER LOOP

    194	001056					REPEAT

    195	001056					    CALL GETFRAME			; GET NEXT COMMAND

    196	001062					    LET R0	:B= -1(R5)		; GET ACTION CODE

    197	001066					    IFB R0 IS LE ORB R0 GE #MAXP2C THEN	; CODE OUT OF RANGE ?

    198	001100						LET R0	:= 0			; ZERO ENTRY CALLS "ILLEGAL" ROUTINE

    199	001102					    END;IF

    200	001102					    LET R0	:= R0 L.SHIFT 1		; CONVERT TO WORDS

    201	001104					CALL	@P2TAB(R0)		; CALL ROUTINE

    202	001110					UNTIL PARSE IS FALSE			; P.END SETS "PARSE" FALSE

    203

    204	001116					RETURN					;

    205

    206

    207		000001 			.END

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 40-1

SYMBOL TABLE



AUGRB = 000121 G 	HD.CPY= 000004 G 	L7      000476R     003	P.PSEC= ****** GX	STORB = 000047 G

A3    = 000002   	HD.INP= 000002 G 	MACLGT= ****** GX	P.RDEF= ****** GX	STORL = 000037 G

BLNK  = 000040   	HD.MHD= 000000 G 	MAIN  = ****** GX	P.REF = ****** GX	STORSB= 000035 G

B0      000234R     003	HD.MRS= 000001 G 	MAXP2C= 000063   	P.REST= ****** GX	STORSW= 000036 G

B1      000270R     003	HD.STS= 000005 G 	M.ARGC= 000014   	P.SAME= ****** GX	STORUB= 000043 G

B10     001056R     003	HD.TIT= 000003 G 	M.ARGS= 000016   	P.SAVE= ****** GX	STORUW= 000044 G

B2      000304R     003	HEDSET= ****** GX	M.END = 000012   	P.SBTT= ****** GX	STORW = 000050 G

B3      000314R     003	IDENTB= ****** GX	M.GETL= 000004   	P.SPIC= ****** GX	STOSB = 000024 G

B4      000354R     003	IDENTP= ****** GX	M.IFLV= 000006   	P.SPID= ****** GX	STOSW = 000025 G

B5      000414R     003	IIII  = 177777   	M.IFVL= 000010   	P.STIB= ****** GX	STOUSB= 000041 G

B6      000460R     003	LBLS0 = 000025   	M.LINK= 000000   	P.STIL= ****** GX	STOUSW= 000042 G

B7      000522R     003	LBLS1 = 000024   	M.NXTL= 000002   	P.STIW= ****** GX	STOV  = 000040 G

CMLINE= ****** GX	LBLS2 = 000024   	NEWPND= ****** GX	P.STKE= ****** GX	STOW  = 000046 G

COMMA = 000054   	LBLS3 = 000021   	OBJBUF= ****** GX	P.STKG= ****** GX	STOWD = 000030 G

CR    = 000015   	LF    = 000012   	OBJBYT= ****** GX	P.STKL= ****** GX	STPBB = 000004 G

DATIPT= ****** GX	LFTANG= 000074   	OBJNAM= ****** GX	P.STKP= ****** GX	STPBL = 000006 G

DECOUT= ****** GX	LINENM= ****** GX	OBJPTR= ****** GX	P.STKS= ****** GX	STPBW = 000005 G

EN.GBL= ****** GX	LISTLV= ****** GX	OB.DBG= 000004 G 	P.STOL= ****** GX	SYMCHR= 000012

ERRLST= ****** GX	LOWCAS= 000140   	OB.EOM= 000003 G 	P.STRB= ****** GX	SYMFLA= 000002

ER.CRP= 000003 G 	LPTHD2= ****** GX	OB.GSD= 000001 G 	P.STRL= ****** GX	SYMLEN= 000011

ER.ERR= 000002 G 	LPTLEN= 000074   	OB.MHD= 000000 G 	P.STRW= ****** GX	SYMLIN= 000000

ER.OK = 000000 G 	LSTLIN= ****** GX	OB.TIR= 000002 G 	P.STSB= ****** GX	SYMMAX= 000017

ER.WRN= 000001 G 	LSTLPT= ****** GX	OB.TRC= 000005 G 	P.STSW= ****** GX	SYMSEG= 000010

E0      000240R     003	L.ADD = 000063 G 	OUTOBJ= ****** GX	P.SUB = ****** GX	SYMVL1= 000004

E1      000274R     003	L.AND = 000067 G 	PARSE = ****** GX	P.WRN = ****** GX	SYMVL2= 000006

E10     001116R     003	L.ASH = 000075 G 	PC1   = ****** GX	P.XOR = ****** GX	S.ABS = 004000

E2      000310R     003	L.COM = 000073 G 	PC2   = ****** GX	P2    = ****** GX	S.ASN = 000200

E3      000322R     003	L.DIV = 000066 G 	PSECCH= 000020   	P2DRVR  000000RG    003	S.DBG = 002000

E4      000360R     003	L.EOR = 000071 G 	PSECOP= 000016   	P2LINE= ****** GX	S.DF  = 100000

E5      000420R     003	L.INSV= 000074 G 	PSECTP= ****** GX	P2TAB   000000RG    002	S.EPT = 000100

E6      000464R     003	L.MUL = 000065 G 	PSECV1= 000012   	RECTYP= ****** GX	S.EXTN= 010000

E7      001024R     003	L.NEG = 000072 G 	PSECV2= 000014   	REDEF = 000101 G 	S.GLOB= 020000

FF    = 000014   	L.NOP = 000062 G 	P.ADD = ****** GX	RGTANG= 000076   	S.LOCL= 001000

FP.GBL= 000020 G 	L.OR  = 000070 G 	P.AND = ****** GX	RTNVAL=%000000   	S.ODBG= 000040

FP.OVL= 000004 G 	L.ROT = 000077 G 	P.ASH = ****** GX	R.SEQ = ****** GX	S.REF = 000400

FP.PIC= 000001 G 	L.SUB = 000064 G 	P.ASN = ****** GX	R6    =%000006   	S.TKMS= 000377

FP.RD = 000200 G 	L.USH = 000076 G 	P.AUGP= ****** GX	R7    =%000007   	S.WEAK= 040000

FP.REL= 000010 G 	L0      000142R     003	P.BDST= ****** GX	SEMI  = 000073   	TAB   = 000011

FP.SHR= 000040 G 	L1      000220R     003	P.CHKL= ****** GX	SETRB = 000120 G 	TITLEP= ****** GX

FP.UNI= 000002 G 	L10     001024R     003	P.DIV = ****** GX	SPACE = 000040   	TITTXT= ****** GX

FP.WRT= 000400 G 	L11     000552R     003	P.END = ****** GX	STABFI= 000011 G 	TYPS0 = 000000

FP.XEQ= 000100 G 	L12     000552R     003	P.EPT = ****** GX	STAEPM= 000014 G 	TYPS1 = 000000

FRMBUF= ****** GX	L13     001016R     003	P.ERR = ****** GX	STAG  = 000000 G 	TYPS2 = 000000

FRMPTR= ****** GX	L14     000632R     003	P.FLAG= ****** GX	STAL  = 000003 G 	TYPS3 = 000000

FRMTOP= ****** GX	L15     000634R     003	P.FNEW= ****** GX	STALFI= 000013 G 	VAXBLK= ****** GX

FS.DEF= 000002 G 	L16     000650R     003	P.ILG = ****** GX	STASB = 000001 G 	VRSION= ****** GX

FS.REL= 000010 G 	L17     000664R     003	P.LGLA= ****** GX	STASW = 000002 G 	WRTLST= ****** GX

FS.UNI= 000004 G 	L2      000230R     003	P.MACL= ****** GX	STAUSB= 000007 G 	WRTOBJ= ****** GX

FS.VAL= 000020 G 	L20     000774R     003	P.MUL = ****** GX	STAUSW= 000010 G 	XTITLE= ****** GX

FS.WK = 000001 G 	L21     001016R     003	P.NEG = ****** GX	STAWFI= 000012 G 	$COUNT= 000063

F.RTYP= ****** GX	L22     001040R     003	P.NEWL= ****** GX	STOB  = 000045 G 	$DIDDO= 000000

F.SEQN= ****** GX	L23     001100R     003	P.NEWP= ****** GX	STOBD = 000027 G 	$E$   = 000001

GETFRA= ****** GX	L24     001102R     003	P.NOT = ****** GX	STOL  = 000026 G 	$F$   = 000000

GETLIN= ****** GX	L3      000252R     003	P.OP  = ****** GX	STOLD = 000031 G 	$I$   = 000001

GS.EPT= 000002 G 	L4      000264R     003	P.OR  = ****** GX	STOLI = 000032 G 	$L    = 000011

GS.PDF= 000000 G 	L5      000274R     003	P.PRIL= ****** GX	STOPIC= 000034 G 	$LL   = 000010

GS.SDF= 000001 G 	L6      000466R     003	P.PRT = ****** GX	STOPID= 000033 G 	$L$   = 000000

P2DRVR	MACRO M1110  21-AUG-78 23:02  PAGE 40-2

SYMBOL TABLE



$O$   = 000000   	$SV$  = 000000   	$T2   = 000010   	$Z$   = 000000   	$$T   = 000025

$P2$  = 000001   	$T    = 000026   	$Y$   = 000000   	$$S   = 000000   	$$TT  = 000024

$R    = 177777   	$T1   = 000005



. ABS.	000000	   000

      	000000	   001

P2ITAB	000146	   002

P2DRVR	001120	   003

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  12910 WORDS  ( 51 PAGES)

DYNAMIC MEMORY:  14388 WORDS  ( 55 PAGES)

ELAPSED TIME:  00:03:06

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

