APSECT	MACRO M1110  21-AUG-78 22:45

TABLE OF CONTENTS



    32-    4	PSECT DIRECTIVE

    33-  137	SAVE/RESTORE PSECT CONTEXT

    34-  181	PSECT OPTION TABLE

APSECT	MACRO M1110  21-AUG-78 22:45  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$

APSECT	MACRO M1110  21-AUG-78 22:45  PAGE 32





      1					.TITLE	APSECT

      2	000000				.PSECT	APSECT

      3					.GLOBL	PSECT,	CSAVE,	CRESTO

      4					.SBTTL	PSECT DIRECTIVE

      5					;++

      6					;

      7					; THE PSECT DIRECTIVE CHANGES THE SEGMENT INTO WHICH THE CODE

      8					; IS ASSEMBLED.

      9					;

     10					;--

     11

     12	000000				PSECT:				; DIRECTIVE = KPSECT

     13	000000					SAVAL					; SAVE R0 - R5

     14	000004					IF EN.LSB+SYMVL2 IS EQ THEN		; IF NOT LSB

     15	000012					    LET LSB	:= LSB +1		; BUMP UP TO NEXT LSB

     16	000016					END

     17	000016					CALL	SETPC				; UPDATE PC

     18	000022					CALL SYMSCN				; GET PSECT NAME

     19	000026					IF R3 IS NE THEN			; NAME THERE?

     20	000032					    LET R4	:= VAL1 + #SYMCHRS	; R4 IS LAST ADDRESS TO TRANSFER

     21	000042					    LET R0	:= R3 + #6		; EXTENDING BLK 3 WORDS

     22	000050					    PUSH R0				; SAVE END OF BLOCK

     23	000052					    REPEAT				; SHIFT NAME DOWN 3 WORDS

     24	000052						LET -(R0) := -(R3)		; COPY NAME

     25	000054					    UNTIL R3 EQ R4			; JUST COPY NAME

     26	000060					    POP  R3				; END OF BLOCK GOES TO R3

     27	000062					    LET INSERT	:= TRUE			; INSERT IF NOT FOUND

     28	000070					    LET R2	:= #PSECTN		; SEARCH NAME TABLE

     29	000074					    CALL FINDPSECT			; LOOK FOR PSECT BLOCK

     30	000100					ELSE

     31	000102					    LET R2	:= #BLNKP		; USE BLANK PSECT

     32	000106					    LET SYMFLAGS(R2) := SYMFLAGS(R2) SET.BY #S.REF ; REFERENCED FLAG

     33	000114					END

     34	000114					LET PSECTP	:= R2			; SAVE PSECT POINTER

     35	000120					IF #S.DF SET.IN SYMFLAG(R2) THEN	; IS THIS ALREADY DEFINED?

     36	000130					    LET R4	:= PSECOP(R2)		; PICK UP OPTIONS

     37	000134					    LET PSCTPOS	:= R4			; COPY OPTION FLAGS

     38	000140					    LET PSCTNEG	:= R4			; LOAD VALUE INTO NEGATIVE

     39	000144	005167 	000000G			    COM PSCTNEG				; NEED TO HAVE COMPLEMENT OF FLAGS

     40	000150					ELSE

     41	000152					    LET R4	:= #PSDFLT		; SET DEFAULT OPTIONS

     42	000156					    LET PSCTPOS	:= 0			; INITIALIZE POSITIVE SENSE

     43	000162					    LET PSCTNEG	:= 0			; INITIALIZE NEGATIVE SENSE

     44	000166					END;IF

     45	000166					LET PSECTO	:= #PS.OPT		; POINT TO PSECT OPTION LIST

     46	000174					LET INSERT	:= FALSE		; DON'T ADD OPTION NAMES

     47	000200					WHILE CHAR NE #CR			; ONCE PER ARG

     48	000210					    SPNOR				; IGNORE BLANKS

     49	000214					    IF CHAR EQ #COMMA THEN		; IGNORE COMMA

     50	000224						CALL GETCHR			; SCAN OVER IT

     51	000230						SPNOR

     52	000234					    END

     53	000234					    IF CHAR NE #CR THEN			; STOP AT EOL

     54	000244						PUSH	R4

     55	000246						IF CHRTAB(R0) EQ #NUMBER THEN 	; DIGIT?

     56	000256						    IF #40000 SET.IN PSCTNEG THEN ; ALIGNMENT SEEN?

     57	000266							CALL CONFLIT		; CONFLICTING OPTIONS

APSECT	MACRO M1110  21-AUG-78 22:45  PAGE 32-1

PSECT DIRECTIVE



     58	000272							CALL ERRFIX		; FIX UP ERROR CONDITION

     59	000276							POP R4			; RESTORE R4

     60	000300						    ELSE

     61	000302							CALL DNUMBER		; GET ALIGNMENT

     62	000306							IF VAL1 HI #9. THEN	; ALIGNMENT TOO BIG

     63	000316							    LET VAL1 := #9.	; SET ALIGNMENT TO PAGE

     64	000324							    CALL ERORLN,#ALNTBG	;

     65	000334							END

     66	000334							POP R4			; RESTORE R4

     67	000336							LET R0 := VAL1 SHIFT #9. SET.BY #40000

     68											; SHIFT INTO POSITION

     69	000352							LET R4 := R4 SET.BY R0 	; SET ALIGNMENT

     70	000354							LET PSCTNEG := PSCTNEG SET.BY R0 ; ALIGNMENT CHK BITS

     71	000360						    END;IF

     72	000360						ELSE

     73	000362						    CALL SYMSCN			; ACCUMULATE OPTION NAME

     74	000366						    POP R4

     75	000370						    IF R3 IS EQ THEN		; IF SPECIFIED

     76	000374							CALL ERORLN,#DIRERR	; DIRECTIVE SYNTAX ERROR

     77	000404							CALL ERRFIX		; TRY TO FIX ERROR

     78	000410						    ELSE

     79	000412							LET R2	:= #PSECTO 	; PSECT OPTION LIST PTR

     80	000416							PUSH R4			; SAVE BITS

     81	000420							CALL FINDSYM		; LOOKUP OPTION

     82	000424							POP R4			; RESTORE BITS

     83	000426							IF R2 IS EQ THEN 	; FOUND?

     84	000432							    CALL ERORLN,#ILGPSO		; ILLEGAL OPTION

     85	000442							ELSE

     86	000444							    LET R0	:= SYMVL1(R2)	; GET BIT

     87	000450							    IF RESULT IS LT THEN	; COMPLEMENT?

     88	000452	005100 							COM R0

     89	000454								IF R0 SET.IN PSCTPOS THEN ; OPPOSITE SET?

     90	000462								    CALL CONFLIT	; CONFLICT

     91	000466								ELSE

     92	000470								    LET R4 := R4 OFF.BY R0 ; CLEAR OPTION

     93	000472								    LET PSCTNEG := PSCTNEG SET.BY R0 ; SAVE FOR CHECK

     94	000476								END

     95	000476							    ELSE

     96	000500								IF R0 SET.IN PSCTNEG THEN	; BAD OPTION?

     97	000506								    CALL CONFLIT		; CONFLICT

     98	000512								ELSE

     99	000514								    LET R4 := R4 SET.BY R0 	; SET OPTION

    100	000516								    LET PSCTPOS := PSCTPOS SET.BY R0 ; SAVE FOR CHECK

    101	000522								    IF #40000 SET.IN R0 THEN	; ALIGNMENT?

    102	000530									LET PSCTNEG := PSCTNEG SET.BY R0

    103	000534								    END				; TO CHK ALIGN.

    104	000534								END;IF

    105	000534							    END;IF

    106	000534							END;IF

    107	000534						    END;IF

    108	000534						END;IF

    109	000534					    END;IF

    110	000534					END;W

    111	000540					LET R2 := PSECTP			; POINT TO PSECT

    112	000544					IF #S.DF OFF.IN SYMFLAGS(R2) THEN	; NEW PSECT?

    113	000554					    LET SYMFLAGS(R2) := SYMFLAGS(R2) SET.BY #S.DF!S.REF

    114	000562					    LET PSECOP(R2) := R4		; LOAD PSECT OPTIONS INTO BLOCK

APSECT	MACRO M1110  21-AUG-78 22:45  PAGE 32-2

PSECT DIRECTIVE



    115	000566					    OUT		#I.NEWP,R2		; DEFINE NEW PSECT

    116	000600					    LET PSTMAX	:= PSTMAX +1		; ONE MORE SEGMENT

    117	000604					    IF PSTMAX HIS #256. THEN		; ONLY 255 PSECTS ALLOWED

    118	000614						CALL ERORLN,#PSTOOM		;

    119	000624					    END

    120	000624					    LET SYMSEG(R2) :B= PSTMAX		; SAVE SEG #

    121	000632					    LET SYMVL1(R2) := 0			; START AT RELATIVE 0

    122	000636					    LET SYMVL2(R2) := 0

    123	000642					    LET PSECV1(R2) := 0			; CURRENT LOCATION STARTS AT 0

    124	000646					    LET PSECV2(R2) := 0			;

    125	000652					END

    126	000652					OUT		#I.PSECT,R2		; SWITCH TO NEW PSECT

    127	000664					LET PC1		:= SYMVL1(R2)		; GET OLD PC

    128	000672					LET PC2		:= SYMVL2(R2)

    129	000700					LET PSTNUM	:B= SYMSEG(R2)		; GET SEG #

    130	000706					LET PSECTP	:= R2			; POINT TO PSECT NAME

    131	000712					RETURN

    132

    133	000714				CONFLIT:

    134	000714					CALL ERORLN,#PSOPCN			; PSECT OPTION CONFLICT

    135	000724					RETURN

APSECT	MACRO M1110  21-AUG-78 22:45  PAGE 33

SAVE/RESTORE PSECT CONTEXT



    137					.SBTTL	SAVE/RESTORE PSECT CONTEXT

    138

    139	000726				CSAVE:				; DIRECTIVE = KSAVE

    140

    141	000726					IF SAVPTR HIS #SAVBUN THEN

    142	000736					    CALL ERORPT,#SAVOVF			; PSECT CONTEXT BUFFER OVERFLOW

    143	000746					ELSE

    144	000750					    LET @SAVPTR	:B= PSTNUM		; SAVE PSECT NUMBER

    145	000756					    LET SAVPTR	:= SAVPTR +1		; POINT TO NEXT BYTE IN STACK

    146	000762					    LET R0	:= PSECTP		; GET ADDRESS OF CURRENT PSECT BLK

    147	000766					    OUT #I.SAVE,R0			; SAVE DIRECTIVE

    148	001000					    LET PSECV1(R0) := PC1		; SAVE CURRENT LOCATION COUNTER

    149	001006					    LET PSECV2(R0) := PC2		;

    150	001014					END

    151	001014					RETURN

    152

    153	001016				CRESTORE:			; DIRECTIVE = KRESTORE

    154

    155	001016					CALL	SETPC				; SAVE MAXIMUM LOCATION COUNTER

    156	001022					IF SAVPTR LOS #SAVBUF THEN		; IN BOUNDS?

    157	001032					    CALL ERORPT,#SAVUND			; PSECT CONTEXT BUFFER UNDERFLOW

    158	001042					    LET R1	:= PSECTP		; POINT TO CURRENT PSECT

    159	001046					ELSE

    160	001050					    LET SAVPTR	:= SAVPTR -1		; POP STACK POINTER ONE BYTE

    161	001054					    LET R0	:B= @SAVPTR		; GET PSECT NUMBER FROM STACK

    162	001060					    IFB R0 EQ #1 THEN			; BLANK PSECT ?

    163	001066						LET R1 := #BLNKP		; BLANK PSECT

    164	001072					    ELSE

    165	001074						LET R1	:= PSECTN		; POINT TO PSECT NAMES

    166	001100						WHILE R1 IS NE			; ONCE PER NAME

    167	001104						    IFB R0 EQ SYMSEG(R1) THEN	; MATCH?

    168	001112							LEAVE			; EXIT WHEN PSECT FOUND

    169	001114						    END;IF

    170	001114						    LET R1	:= (R1)		; NO, MOVE TO NEXT PSECT

    171	001116						END;W

    172	001120					    END;IF

    173	001120					    OUT #I.REST,R1			; RESTORE PSECT (ADDR. IN R1)

    174	001132					    LET PSECTP	:= R1			; POINT TO RESTORED PSECT

    175	001136					END;IF

    176	001136					LET PSTNUM	:B= SYMSEG(R1)		; SET PSECT NUMBER

    177	001144					LET PC1		:= PSECV1(R1)		; SET NEW PC

    178	001152					LET PC2		:= PSECV2(R1)

    179	001160					RETURN

APSECT	MACRO M1110  21-AUG-78 22:45  PAGE 34

PSECT OPTION TABLE



    181					.SBTTL	PSECT OPTION TABLE

    182	000000					.PSECT	PSECDT	D

    183					;++

    184					;

    185					; PSECT OPTIONS.  COMPLEMENTED OPTIONS ARE MARKED WITH COMPLEMENTED

    186					; VALUES.

    187					;

    188					;--

    189		000000 				INSYMP = 0				; START OF LIST

    190

    191	000000					INSYM	PIC,	001			; POSITION INDEPENDENT

    192	000016					INSYM	NOPIC,	<^C1>			; NOT PIC

    193	000036					INSYM	LIB,	002			; UNIVERSAL

    194	000054					INSYM	USR,	<^C2>			; USER (NOT UNIVERSAL)

    195	000072					INSYM	OVR,	004			; OVERLAID

    196	000110					INSYM	CON,	<^C4>			; CONCATENATED

    197	000126					INSYM	REL,	010			; RELOCATABLE

    198	000144					INSYM	ABS,	<^C10>			; ABSOLUTE

    199	000162					INSYM	GBL,	020			; GLOBAL

    200	000200					INSYM	LCL,	<^C20>			; LOCAL

    201	000216					INSYM	SHR,	040			; SHAREABLE

    202	000234					INSYM	NOSHR,	<^C40>			; NOT SHAREABLE

    203	000254					INSYM	EXE,	100+200			; EXECUTABLE (READABLE)

    204	000272					INSYM	NOEXE,	<^C100>			; NOT EXECUTEABLE

    205	000312					INSYM	RD,	200			; READABLE

    206	000326					INSYM	NORD,	<^C200>			; NO READ

    207	000344					INSYM	WRT,	400+200			; WRITEABLE (READABLE)

    208	000362					INSYM	NOWRT,	<^C400>			; NO WRITE

    209	000402					INSYM	BYTE,	40000			; BYTE ALIGNMENT

    210	000420					INSYM	WORD,	41000			; WORD ALIGNMENT

    211	000436					INSYM	LONG,	42000			; LONGWORD ALIGNMENT

    212	000454					INSYM	QUAD,	43000			; QUAD ALIGNMENT

    213	000472				PS.OPT::INSYM	PAGE,	51000			; PAGE ALIGNMENT

    214

    215		000710 				PSDFLT == 10 + 100 + 200 + 400		; DEFAULT: REL,RW,XEQ

    216

    217		000001 			.END

APSECT	MACRO M1110  21-AUG-78 22:45  PAGE 34-1

SYMBOL TABLE



ALNTBG= ****** GX	I.REST= ****** GX	L30     000534R     002	PSECTP= ****** GX	S.EXTN= 010000

BLNK  = 000040   	I.SAVE= ****** GX	L31     000652R     002	PSECV1= 000012   	S.GLOB= 020000

BLNKP = ****** GX	LBLS0 = 000036   	L32     000624R     002	PSECV2= 000014   	S.LOCL= 001000

B0      000052R     002	LBLS1 = 000040   	L33     000750R     002	PSOPCN= ****** GX	S.ODBG= 000040

B1      000200R     002	LBLS10= 000030   	L34     001014R     002	PSTMAX= ****** GX	S.REF = 000400

B2      001100R     002	LBLS2 = 000041   	L35     001050R     002	PSTNUM= ****** GX	S.TKMS= 000377

CHAR  = ****** GX	LBLS3 = 000002   	L36     001136R     002	PSTOOM= ****** GX	S.WEAK= 040000

CHRTAB= ****** GX	LBLS4 = 000042   	L37     001074R     002	PS.OPT  000472RG    003	TAB   = 000011

CNT   = 000004   	LBLS5 = 000021   	L4      000152R     002	RGTANG= 000076   	TYPS0 = 000000

COMMA = 000054   	LBLS6 = 000025   	L40     001120R     002	RTNVAL=%000000   	TYPS1 = 000000

CONFLI  000714R     002	LBLS7 = 000027   	L41     001120R     002	R6    =%000006   	TYPS10= 000000

CR    = 000015   	LF    = 000012   	L42     001114R     002	R7    =%000007   	TYPS2 = 000000

CRESTO  001016RG    002	LFTANG= 000074   	L5      000166R     002	SAVBUF= ****** GX	TYPS3 = 000001

CSAVE   000726RG    002	LOWCAS= 000140   	L6      000540R     002	SAVBUN= ****** GX	TYPS4 = 000000

DIRERR= ****** GX	LPTLEN= 000074   	L7      000234R     002	SAVOVF= ****** GX	TYPS5 = 000000

DNUMBE= ****** GX	LSB   = ****** GX	M.ARGC= 000014   	SAVPTR= ****** GX	TYPS6 = 000000

EN.LSB= ****** GX	L0      000016R     002	M.ARGS= 000016   	SAVUND= ****** GX	TYPS7 = 000000

ERORLN= ****** GX	L1      000102R     002	M.END = 000012   	SEMI  = 000073   	VAL1  = ****** GX

ERORPT= ****** GX	L10     000534R     002	M.GETL= 000004   	SETPC = ****** GX	$DIDDO= 000000

ERRFIX= ****** GX	L11     000362R     002	M.IFLV= 000006   	SKIPSP= ****** GX	$E$   = 000001

E0      000060R     002	L12     000302R     002	M.IFVL= 000010   	SPACE = 000040   	$F$   = 000000

E1      000540R     002	L13     000360R     002	M.LINK= 000000   	SYMCHR= 000012   	$I$   = 000001

E2      001120R     002	L14     000334R     002	M.NXTL= 000002   	SYMFLA= 000002   	$L    = 000003

FF    = 000014   	L15     000534R     002	NUMBER= ****** GX	SYMLEN= 000011   	$LL   = 000001

FINDPS= ****** GX	L16     000412R     002	OUTFRA= ****** GX	SYMLIN= 000000   	$L$   = 000000

FINDSY= ****** GX	L17     000534R     002	PC1   = ****** GX	SYMMAX= 000017   	$O$   = 000000

GETCHR= ****** GX	L20     000444R     002	PC2   = ****** GX	SYMSCN= ****** GX	$R    = 177777

IIII  = 177777   	L21     000534R     002	PSCTNE= ****** GX	SYMSEG= 000010   	$T    = 000043

ILGPSO= ****** GX	L22     000500R     002	PSCTPO= ****** GX	SYMVL1= 000004   	$T1   = 000000

INSERT= ****** GX	L23     000470R     002	PSDFLT= 000710 G 	SYMVL2= 000006   	$T2   = 000036

INSYMC= 000004   	L24     000476R     002	PSECCH= 000020   	S.ABS = 004000   	$Y$   = 000000

INSYMP= 000472R     003	L25     000534R     002	PSECOP= 000016   	S.ASN = 000200   	$Z$   = 000000

INSYTM= 000472R     003	L26     000514R     002	PSECT   000000RG    002	S.DBG = 002000   	$$T   = 000041

I.NEWP= ****** GX	L27     000534R     002	PSECTN= ****** GX	S.DF  = 100000   	.SAVAL= ****** GX

I.PSEC= ****** GX	L3      000114R     002	PSECTO= ****** GX	S.EPT = 000100   	.$T   = 000001



. ABS.	000000	   000

      	000000	   001

APSECT	001162	   002

PSECDT	000510	   003

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  11936 WORDS  ( 47 PAGES)

DYNAMIC MEMORY:  13332 WORDS  ( 51 PAGES)

ELAPSED TIME:  00:02:33

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

