P2IO	MACRO M1110  21-AUG-78 23:17

TABLE OF CONTENTS



    32-    8	PASS 2 INPUT / OUTPUT ROUTINES

    32-   11	GETFRAME	GET NEXT INTERMEDIATE CODE BLOCK

    33-   39	WRTOBJ		OUTPUT OBJECT CODE BLOCK

    34-   59	OBJNAM		WRITE SYMBOL NAME TO OBJECT CODE

    34-   85	OUTOBJ		OUTPUT BYTE TO OBJECT CODE

    35-  103	STOIM		OPTIMIZE STORE IMMEDIATE LINKER COMMANDS

    36-  127	WRTTTY		WRITE LINE TO TERMINAL

    37-  139	LSTBYT		OUTPUT HEX BYTE TO LISTING FILE

    38-  183	P2EMSG		SIGNAL PASS 2 ERROR

    39-  203	LSTCHAR		OUTPUT CHARACTER TO LISTING FILE

    39-  217	LFORM		WRITE "N" HEX DIGITS INTO THE LISTING

    40-  242	WRTLST		MOVE LINE BUFFER TO LISTING FILE

    41-  319	HEADER		OUTPUT PAGE HEADER

    42-  349	HEDSET		SET UP HEADER LINE

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

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 32





      1					.TITLE	P2IO

      2	000000				.PSECT	P2IO

      3					.MCALL	GET$S,	PUT$S,	QIOW$,	DIR$

      4

      5					.GLOBL	GETFRA,	WRTOBJ,	OBJNAM,	OBJPSC,	OUTOBJ,	STOIM,	WRTTTY

      6					.GLOBL	LSTBYT,	LSTCHA,	LFORM,	WRTLST,	HEADER,	HEDSET,	P2EMSG

      7

      8					.SBTTL	PASS 2 INPUT / OUTPUT ROUTINES

      9

     10

     11					.SBTTL	GETFRAME	GET NEXT INTERMEDIATE CODE BLOCK

     12					;+

     13					;	GETFRAME -- GET NEXT INTERMEDITE CODE BLOCK

     14					;-

     15

     16	000000				GETFRAME::				; INPUT NEXT FRAME OF INTERMEDIATE CODE

     17

     18	000000					LET R5		:= FRMPTR		; POINT TO NEXT FRAME

     19	000004					IF R5 HIS FRMTOP THEN			; READ NEW BUFFER

     20	000012					    DIR$ #INTQIO			; READ NEXT BLOCK

     21	000020	103427 				    BCS	 GETERR				; SKIP IF QIO FAILED

     22	000022	105767 	000000G			    TSTB INTRSB				; STATUS SHOULD BE POSITIVE

     23	000026	003424 				    BLE	 GETERR				; SKIP IF STATUS IS BAD

     24	000030	062767 	000003 	000000C		    ADD	#3,INTQIO+Q.IOPL+10		; POINT TO NEXT VIRTUAL BLOCK

     25	000036	005567 	000000C			    ADC	INTQIO+Q.IOPL+6			;

     26	000042	016767 	000000G	000000G		    MOV FRMPTR,FRMTOP			; POINTER TO END OF DATA

     27	000050	012705 	000000G			    MOV	#FRMBUF,R5			; RESET READ POINTER

     28	000054	010567 	000000G			    MOV	R5,FRMPTR			;

     29	000060					END;IF

     30	000060					LET R0		:B= (R5)		; GET ITS LENGTH

     31	000062					LET FRMPTR	:= R0 + R5		; POINT TO NEXT FRAME

     32	000072					LET R5		:= R5 + #2		; POINT TO FIRST DATA ELEMENT

     33	000076					RETURN

     34

     35

     36	000100				GETERR:	ERRPRT	WRKINP				; INTERMEDIATE FILE INPUT ERROR

     37	000114	000167 	000000G			JMP	ABORT				; DELETE OBJECT FILE, EXIT

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 33

WRTOBJ		OUTPUT OBJECT CODE BLOCK



     39					.SBTTL	WRTOBJ		OUTPUT OBJECT CODE BLOCK

     40					;++

     41					;

     42					; WRITE OUT OBJECT CODE BUFFER TO THE OBJECT CODE FILE.

     43					;

     44					;--

     45

     46	000120				WRTOBJ::				;WRITE OBJECT CODE FILE

     47	000120	022767 	000001G	000000G		CMP	#OBJBUF+1,OBJPTR	;OBJECT BUFFER EMPTY?

     48	000126	103017 				BHIS	10$			;IF HIS YES

     49	000130	010046 				MOV	R0,-(SP)		;SAVE REGISTER

     50	000132	016746 	000000G			MOV	OBJPTR,-(SP)		;CALCULATE LENGTH OF OBJECT RECORD

     51	000136	162716 	000000G			SUB	#OBJBUF,(SP)		;

     52	000142					PUT$S	#OBJBLK,#OBJBUF,(SP)+	;OUTPUT RECORD

     53	000164	012600 				MOV	(SP)+,R0		;RESTORE REGISTER

     54	000166	116767 	000000G	000000G	10$:	MOVB	RECTYP,OBJBUF		;SET RECORD TYPE

     55	000174	012767 	000001G	000000G		MOV	#OBJBUF+1,OBJPTR	;SET BUFFER POINTER

     56	000202	005067 	000000G			CLR	STOIMF			;SET IMMEDIATE FLAG FALSE

     57	000206					RETURN				;

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 34

OBJNAM		WRITE SYMBOL NAME TO OBJECT CODE



     59					.SBTTL	OBJNAM		WRITE SYMBOL NAME TO OBJECT CODE

     60					;++

     61					;

     62					; WRITE SYMBOL NAME INTO OBJECT CODE BUFFER, R1 POINTS TO SYMBOL BLOCK

     63					; ENTRY POINT LOADS R0 WITH OFFSET TO ASCII NAME STRING.

     64					;

     65					;--

     66

     67	000210				OBJPSCT::

     68	000210					LET R0	:= #PSECCH			; OFFSET TO PSECT NAME

     69	000214					GOTO	NAMOBJ				;

     70	000216				OBJNAM::

     71	000216					LET R0	:= #SYMCHRS			; OFFSET TO SYMBOL NAME

     72	000222				NAMOBJ:

     73	000222					PUSH	R1,R2

     74	000226					LET R2	:B= SYMLEN(R1)			; LENGTH OF NAME

     75	000232					LET R1	:= R1 + R0			; POINT TO FIRST CHAR

     76	000234					DATA	R2				; WRITE LENGTH

     77	000244					REPEAT THRU R2				; WRITE NAME

     78	000244					    DATA (R1)+				; ONE BYTE AT A TIME

     79	000254					END;R

     80	000256					POP	R2,R1

     81	000262					RETURN

     82

     83

     84

     85					.SBTTL	OUTOBJ		OUTPUT BYTE TO OBJECT CODE

     86					;++

     87					;

     88					; WRITE BYTE IN "OBJBYT" INTO OBJECT CODE BUFFER, IF THE RECORD TYPE "RECTYP"

     89					; HAS BEEN CHANGED FIRST WRITE OUT THE CURRENT BUFFER.  THIS ROUTINE ALSO SETS

     90					; THE STORE IMMEDIATE FLAG TO FALSE.

     91					;

     92					;--

     93

     94	000264				OUTOBJ::				; WRITE BYTE TO OBJECT CODE BUFFER

     95	000264					IFB RECTYP NE OBJBUF			; DIFFERENT RECORD TYPE

     96	000274					    CALL WRTOBJ				; WRITE OUT OLD RECORD

     97	000300					END

     98	000300					LET @OBJPTR	:B= OBJBYT		; STORE BYTE TO OUTPUT

     99	000306					LET OBJPTR	:= OBJPTR +1		; BUMP POINTER

    100	000312					LET STOIMF	:= FALSE		; NO LONGER STORE IMMEDIATE

    101	000316					RETURN

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 35

STOIM		OPTIMIZE STORE IMMEDIATE LINKER COMMANDS



    103					.SBTTL	STOIM		OPTIMIZE STORE IMMEDIATE LINKER COMMANDS

    104					;++

    105					;

    106					; ADD THE BYTE IN R0 TO THE STORE IMMEDIATE COMMAND ALREADY IN PROGRESS,

    107					; IF "STOIMF" IS FALSE THEN START A NEW STORE IMMEDIATE COMMAND WITH THIS BYTE.

    108					; THE FIRST BYTE OF A STORE IMMEDIATE COMMAND IS THE TWO'S COMPLEMENT BYTE

    109					; COUNT OF THE STRING UP TO -128 (^O200).

    110					;

    111					;--

    112	000320				STOIM::					; STORE IMMEDIATE BYTE IN OBJECT BUFFER

    113	000320					IF OBJPTR HI #OBJWRN THEN		; BUFFER PTR PAST WARNING LIMIT?

    114	000330					    CALL WRTOBJ				; FLUSH BUFFER IF FULL

    115	000334					END;IF

    116	000334					IF STOIMF IS FALSE THEN			; START NEW STORE IMMEDIATE CMD

    117	000342					    LET STOIMP	:= OBJPTR		; SET POINTER FOR NEW COMMAND

    118	000350					    DATA	#0			; NO DATA STORED YET

    119	000360					END;IF

    120	000360					DATA	R0				; STORE BYTE IN R0

    121	000370					LET @STOIMP	:B= @STOIMP -1		; COUNT BYTE

    122	000374					IFB @STOIMP HI #^O200 THEN		; NOT -128 YET?

    123	000404					   LET STOIMF	:= TRUE			; NO, KEEP OPTIMIZING

    124	000412					END;IF

    125	000412					RETURN

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 36

WRTTTY		WRITE LINE TO TERMINAL



    127					.SBTTL	WRTTTY		WRITE LINE TO TERMINAL

    128					;

    129					; WRITE LISTING LINE TO USER'S TERMINAL

    130					;

    131

    132	000414				WRTTTY::				; WRITE LINE TO TERMINAL

    133	000414					PUSH R1

    134	000416					LET  R1	:= LINELN + #LINEBF-LSTLND ; CALCULATE REAL LINE LENGTH

    135	000426					PUT$S	#TTYBLK,#LSTLND,R1	; WRITE LINE TO TTY

    136	000450					POP  R1

    137	000452					RETURN

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 37

LSTBYT		OUTPUT HEX BYTE TO LISTING FILE



    139					.SBTTL	LSTBYT		OUTPUT HEX BYTE TO LISTING FILE

    140					;

    141					;

    142					;	LSTBYTE -- OUTPUT HEX BYTE TO LISTING FILE

    143					;

    144					;

    145

    146	000454				LSTBYTE::				;WRITE HEXIDECIMAL BYTE TO LISTING

    147	000454	010046 				MOV	R0,-(SP)		;SAVE BYTE TO CONVERT

    148	000456	022767 	000001G	000000G		CMP	#LSTLND+1,LSTLPT	;TIME TO DUMP PRINT BUFFER?

    149	000464	103403 				BLO	10$			;IF LO NO

    150	000466					CALL	WRTLST			;WRITE OUT CURRENT BUFFER

    151	000472	011600 				MOV	(SP),R0			;RETRIEVE BYTE TO CONVERT

    152	000474	042700 	177760 		10$:	BIC	#^C<17>,R0		;ISOLATE LOW DIGIT

    153	000500	005367 	000000G			DEC	LSTLPT			;BACKUP TO NEXT CHARACTER

    154	000504	116077 	000540'	000000G		MOVB	XTAB(R0),@LSTLPT	;INSERT ASCII CHARACTER IN BUFFER

    155	000512	012600 				MOV	(SP)+,R0		;RETRIEVE BYTE

    156	000514	072027 	177774 			ASH	#-4,R0			;SHIFT NEXT DIGIT INTO PLACE

    157	000520	042700 	177760 			BIC	#^C<17>,R0		;ISOLATE LOW DIGIT

    158	000524	005367 	000000G			DEC	LSTLPT			;BACKUP TO NEXT CHARACTER

    159	000530	116077 	000540'	000000G		MOVB	XTAB(R0),@LSTLPT	;INSERT ASCII CHARACTER IN BUFFER

    160	000536					RETURN				;

    161

    162					;

    163					; HEXIDECIMAL TO ASCII CONVERSION TABLE

    164					;

    165

    166	000540	   060 			XTAB:	.BYTE	'0			;

    167	000541	   061 				.BYTE	'1			;

    168	000542	   062 				.BYTE	'2			;

    169	000543	   063 				.BYTE	'3			;

    170	000544	   064 				.BYTE	'4			;

    171	000545	   065 				.BYTE	'5			;

    172	000546	   066 				.BYTE	'6			;

    173	000547	   067 				.BYTE	'7			;

    174	000550	   070 				.BYTE	'8			;

    175	000551	   071 				.BYTE	'9			;

    176	000552	   101 				.BYTE	'A			;

    177	000553	   102 				.BYTE	'B			;

    178	000554	   103 				.BYTE	'C			;

    179	000555	   104 				.BYTE	'D			;

    180	000556	   105 				.BYTE	'E			;

    181	000557	   106 				.BYTE	'F			;

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 38

P2EMSG		SIGNAL PASS 2 ERROR



    183					.SBTTL	P2EMSG		SIGNAL PASS 2 ERROR

    184					;

    185					;

    186					;	P2EMSG -- SIGNAL PASS 2 ERROR

    187					;

    188					; POINTER TO ERROR MESSAGE IS IN R0.  THE POINTER IS SAVED AND

    189					; POINTED TO BY R5 SO THAT THE P.ERR ROUTINE CAN PROCESS THE

    190					; ERROR

    191					;

    192					;

    193

    194	000560				P2EMSG::				; PASS 2 ERROR MESSAGE

    195	000560					PUSH		R5

    196	000562					LET P2ERPT	:= R0			; POINT TO ERROR

    197	000566					LET P2ERPT+2	:= #LINEBF		; WE DON'T KNOW WHERE ERROR HAPPENED

    198	000574					LET R5		:= #P2ERPT		; POINT TO POINTER

    199	000600					CALL		P.ERR			; PROCESS THE ERROR

    200	000604					POP		R5

    201	000606					RETURN

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 39

LSTCHAR		OUTPUT CHARACTER TO LISTING FILE



    203					.SBTTL	LSTCHAR		OUTPUT CHARACTER TO LISTING FILE

    204					;++

    205					;

    206					; WRITE THE ASCII CHARACTER IN R0 INTO THE LISTING BUFFER FROM RIGHT

    207					; TO LEFT.  THE POINTER INTO THE LISTING BUFFER IS DECREMENTED FIRST.

    208					;

    209					;--

    210

    211	000610				LSTCHAR::				; WRITE CHARACTER TO LISTING

    212	000610					LET LSTLPT := LSTLPT - #1		; BACKUP 1 CHAR

    213	000614					LET @LSTLPT :B= R0			; PLACE CHAR IN LINE BUFFER

    214	000620					RETURN

    215

    216

    217					.SBTTL	LFORM		WRITE "N" HEX DIGITS INTO THE LISTING

    218					;++

    219					;

    220					; CALLED VIA "FORMAT #N" THIS ROUTINE WRITES OUT THE DESIRED NUMBER OF BYTES

    221					; FROM THE TOP OF THE 32-BIT STACK.

    222					; R0 HOLDS THE NUMBER OF BYTES TO BE OUTPUT.

    223					;

    224					;--

    225

    226	000622				LFORM:

    227	000622	010246 				MOV	R2,-(SP)		;SAVE REGISTERS

    228	000624	010146 				MOV	R1,-(SP)		;

    229	000626	010002 				MOV	R0,R2			;SET LOOP COUNT

    230	000630	012701 	000000G			MOV	#VAL1,R1		;POINT TO DATA

    231	000634					LPOP	VAL1,VAL2		;POP DATA OFF STACK

    232	000654	112100 			10$:	MOVB	(R1)+,R0		;GET NEXT DATA BYTE

    233	000656					CALL	LSTBYTE			;FORMAT BYTE FOR LISTING

    234	000662					INCRPC	#1			;INCREMENT LOCATION COUNTER

    235	000674	077211 				SOB	R2,10$			;ANY MORE BYTES TO OUTPUT?

    236	000676	005367 	000000G			DEC	LSTLPT			;BACKUP TO NEXT CHARACTER IN PRINT BUFFER

    237	000702	112777 	000040 	000000G		MOVB	#' ,@LSTLPT		;INSERT SPACE IN PRINT BUFFER

    238	000710	012601 				MOV	(SP)+,R1		;RESTORE REGISTERS

    239	000712	012602 				MOV	(SP)+,R2		;

    240	000714					RETURN				;

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 40

WRTLST		MOVE LINE BUFFER TO LISTING FILE



    242					.SBTTL	WRTLST		MOVE LINE BUFFER TO LISTING FILE

    243					;

    244					;

    245					;	WRTLST -- MOVE LISTING LINE BUFFER TO LISTING FILE

    246					;

    247					;

    248

    249	000716				WRTLST::				;OUTPUT LINE TO LISTING FILE

    250	000716	016746 	000000G			MOV	LISTIT,-(SP)		;GET CURRENT LISTING FLAG

    251	000722	005767 	000000G			TST	MACLGT			;CURRENTLY EXPANDING A MACRO?

    252	000726	001423 				BEQ	20$			;IF EQ NO

    253	000730	005767 	000006G			TST	LS.ME+SYMVL2		;MACRO EXPANSION FLAG ON?

    254	000734	001020 				BNE	20$			;IF NE YES

    255	000736	005016 				CLR	(SP)			;CLEAR LISTING FLAG

    256	000740	005767 	000006G			TST	LS.MEB+SYMVL2		;BINARY EXPANSION FLAG ON?

    257	000744	001414 				BEQ	20$			;IF EQ NO

    258	000746	005767 	000000G			TST	MEBLST			;SPECIAL MACRO LIST FLAG ON?

    259	000752	001010 				BNE	10$			;IF NE YES--LIST LINE

    260	000754	026767 	000000G	000000G		CMP	PC1,XPC1		;LAST PC MATCH?

    261	000762	001004 				BNE	10$			;IF NE NO

    262	000764	026767 	000000G	000000G		CMP	PC2,XPC2		;LAST PC MATCH?

    263	000772	001401 				BEQ	20$			;IF EQ YES

    264	000774	010616 			10$:	MOV	SP,(SP)			;SET LISTING FLAG

    265	000776	016700 	000000G		20$:	MOV	LINELN,R0		;GET LENGTH OF OUTPUT LINE

    266	001002	122760 	000014 	177777G		CMPB	#FF,LINEBF-1(R0)	;FORM FEED?

    267	001010	001003 				BNE	30$			;IF NE NO

    268	001012	005367 	000000G			DEC	LINELN			;REDUCE LENGTH OF LINE

    269	001016	001407 				BEQ	40$			;IF EQ ZERO LENGTH LINE

    270	001020	005767 	000000G		30$:	TST	LISTLV			;NEGATIVE LISTING LEVEL?

    271	001024	002404 				BLT	40$			;IF LT YES

    272	001026	003005 				BGT	50$			;IF GT LIST EVERYTHING

    273	001030	022716 	000001 			CMP	#1,(SP)			;".LIST" OR ".NLIST" DIRECTIVE?

    274	001034	001003 				BNE	60$			;IF NE NO

    275	001036	005016 			40$:	CLR	(SP)			;CLEAR LISTING FLAG

    276	001040	000401 				BR	60$			;

    277	001042	010616 			50$:	MOV	SP,(SP)			;SET LISTING FLAG

    278	001044	005726 			60$:	TST	(SP)+			;LISTING FLAG CLEAR?

    279	001046	001441 				BEQ	100$			;IF EQ YES

    280	001050	005767 	000000G			TST	LSTXST			;LISTING FILE SPECIFIED?

    281	001054	001436 				BEQ	100$			;IF EQ NO

    282	001056	010046 				MOV	R0,-(SP)		;SAVE LENGTH OF OUTPUT LINE

    283	001060	005767 	000000G			TST	LPTCT			;LINE COUNT ZERO OR LESS?

    284	001064	003403 				BLE	70$			;IF LE YES

    285	001066	005767 	000000G			TST	NEWPND			;NEW PAGE FORCED?

    286	001072	001402 				BEQ	80$			;IF EQ NO

    287	001074				70$:	CALL	HEADER			;OUTPUT PAGE HEADER

    288	001100	016700 	000000G		80$:	MOV	LINELN,R0		;CALCULATE TOTAL LENGTH OF LINE

    289	001104	062700 	000000C			ADD	#LINEBF-LSTLND,R0	;

    290	001110	020067 	000000G			CMP	R0,MAXWTH		;LINE TOO LONG?

    291	001114	101402 				BLOS	90$			;IF LOS NO

    292	001116	016700 	000000G			MOV	MAXWTH,R0		;GET MAXIMUM LENGTH OF LINE

    293	001122	010067 	000000C		90$:	MOV	R0,LSTBLK+F.NRBD	;SET LENGTH OF OUTPUT BUFFER

    294	001126					PUT$S	#LSTBLK,#LSTLND		;WRITE LINE TO LISTING FILE

    295	001144	005367 	000000G			DEC	LPTCT			;REDUCE COUNT OF LINES REMAINING ON PAGE

    296	001150	012600 				MOV	(SP)+,R0		;RETREIVE LAST CHARACTER OF LINE

    297	001152	122760 	000014 	177777G	100$:	CMPB	#FF,LINEBF-1(R0)	;FORCE NEW PAGE?

    298	001160	001002 				BNE	110$			;IF NE NO

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 40-1

WRTLST		MOVE LINE BUFFER TO LISTING FILE



    299	001162	010667 	000000G			MOV	SP,NEWPND		;SET NEW PAGE FLAG

    300	001166	005067 	000000G		110$:	CLR	LINELN			;CLEAR NUMBER OF CHARACTERS IN BUFFER

    301	001172	012700 	000000G			MOV	#LSTLND,R0		;GET ADDRESS OF LISTING BUFFER

    302	001176	012720 	020040 		120$:	MOV	#"  ,(R0)+		;INSERT BLANKS

    303	001202	022700 	000000G			CMP	#LSTLIN,R0		;ANY MORE SPACE TO FILL?

    304	001206	101373 				BHI	120$			;IF HI YES

    305	001210					LET LSTLPT	:= #LSTLCT		; POINT TO END OF BUFFER

    306	001216					PUSH	VAL1,VAL2			; PREVENT SIDE EFFECTS

    307	001226					LPUSH	PC1,PC2				; PUSH PC

    308	001246					FORMAT	#2				; PRINT 2 BYTES

    309	001256					DECRPC	#2				; CORRECT AUTO INCREMENT

    310	001270					POP	VAL2,VAL1			; RESTORE OLD NUMBERS

    311	001300					LET XPC1	:= PC1			; SAVE CURRENT PC

    312	001306					LET XPC2	:= PC2

    313	001314					LET MEBLST	:= 0			; CLEAR FORCE LISTING FLAG

    314	001320					LET LISTIT	:= TRUE			; ASSUME LINE IS LISTED

    315	001326	005367 	000000G			DEC	LSTLPT			;BACKUP LISTING POINTER

    316	001332	112777 	000040 	000000G		MOVB	#' ,@LSTLPT		;INSERT SPACE IN LINE

    317	001340					RETURN				;

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 41

HEADER		OUTPUT PAGE HEADER



    319					.SBTTL	HEADER		OUTPUT PAGE HEADER

    320					;

    321					; WRITE PAGE HEADER TO LISTING FILE

    322					;

    323

    324	001342				HEADER::

    325	001342					LET NEWPND	:= FALSE		; NEW PAGE NOT PENDING

    326	001346					PUSH		R2,R3			; SAVE REGS

    327	001352					LET LPTCT	:= #LPTLEN		; RESET PAGE LENGTH

    328	001360					PUSH LSTLPT				; SAVE LINE POINTER

    329	001364					LET LSTLPT	:= #LPTHDX		; POINT TO END OF HEADER

    330	001372					LET LPTPAG	:= LPTPAG +1		; INCREMENT PAGE NO.

    331	001376					LET R3		:= LPTPAG		; GET PAGE NUMBER

    332	001402					CALL DECOUT				; OUTPUT IT

    333	001406					LET LSTLPT	:= #SBTLBX-1		; END OF SUB-HEADER LINE

    334	001414					LET @LSTLPT	:B= #')			; STORE CLOSING PARENTHESIS

    335	001422					LET R3		:= SRCPAG		; CONVERT AND PRINT SOURCE PAGE NO

    336	001426					CALL	DECOUT				;

    337	001432					LET LSTLPT	:= LSTLPT -1		; DECREMENT LIST LINE PTR

    338	001436					LET @LSTLPT	:B= #'(			; STORE OPENING PARENTHESIS

    339	001444					IF LSTXST IS TRUE THEN			; HAVE WE A LISTING FILE?

    340	001452					    PUT$S	#LSTBLK,#LPTHDR,#LPTHDX-LPTHDR ; WRITE HEADER

    341	001476					    PUT$S	#LSTBLK,#SBTLB1,#SBTLBX-SBTLB1 ; SUBTITLE

    342	001522					    PUT$S	#LSTBLK,#LPTHDR,#0	; BLANK LINE

    343	001544					    LET LPTCT	:= LPTCT - #3		; COUNT 3 LINES

    344	001552					END;IF

    345	001552					POP	LSTLPT				; POP LISTING POINTER

    346	001556					POP	R3,R2				; POP REGS

    347	001562					RETURN

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 42

HEDSET		SET UP HEADER LINE



    349					.SBTTL	HEDSET		SET UP HEADER LINE

    350					;

    351					; SET UP HEADER LINE

    352					;

    353

    354	001564				HEDSET::

    355	001564					LET R3		:= #SBTLB1		; SUB-HEADER BUFFER

    356	001570					REPEAT THRU R0	:= #SBTLBX-SBTLB1	; CLEAR BUFFER

    357	001574					    LET (R3)+	:B= #SPACE		;

    358	001600					END;R

    359	001602					LET R3		:= #SBTLB1		; SUB-HEADER BUFFER ADDR FOR IDENT

    360	001606					LET R2		:= IDENTP		; POINT TO IDENT

    361	001612					IF R2 IS NE THEN			; IF IT EXISTS

    362	001616					    LET R0	:B= (R2)+		; GET LENGTH

    363	001620					    IF RESULT IS NE THEN		; IF NON-ZERO

    364	001622						REPEAT THRU R0			; COPY IDENT

    365	001622						    LET (R3)+ :B= (R2)+

    366	001624						    IFB -1(R3) EQ #TAB THEN LET -1(R3) :B= #SPACE ; CONVERT TABS TO SPACES

    367	001642						END;R

    368	001644					    END;IF

    369	001644					END;IF

    370	001644					RETURN

    371

    372

    373		000001 			.END

P2IO	MACRO M1110  21-AUG-78 23:17  PAGE 42-1

SYMBOL TABLE



ABORT = ****** GX	LFTANG= 000074   	MEBLST= ****** GX	RTNVAL=%000000   	TTYBLK= ****** GX

A3    = 000000   	LINEBF= ****** GX	M.ARGC= 000014   	R6    =%000006   	TYPS0 = 000000

BLNK  = 000040   	LINELN= ****** GX	M.ARGS= 000016   	R7    =%000007   	TYPS1 = 000000

B0      000244R     002	LISTIT= ****** GX	M.END = 000012   	SBTLBX= ****** GX	TYPS2 = 000006

B1      001574R     002	LISTLV= ****** GX	M.GETL= 000004   	SBTLB1= ****** GX	TYPS3 = 000000

B2      001622R     002	LOWCAS= 000140   	M.IFLV= 000006   	SEMI  = 000073   	VAL1  = ****** GX

COMMA = 000054   	LPTCT = ****** GX	M.IFVL= 000010   	SPACE = 000040   	VAL2  = ****** GX

CR    = 000015   	LPTHDR= ****** GX	M.LINK= 000000   	SRCPAG= ****** GX	V1STAC= ****** GX

DECOUT= ****** GX	LPTHDX= ****** GX	M.NXTL= 000002   	STOIM   000320RG    002	V2STAC= ****** GX

ERRPRI= ****** GX	LPTLEN= 000074   	NAMOBJ  000222R     002	STOIMF= ****** GX	WRKINP= ****** GX

E0      000256R     002	LPTPAG= ****** GX	NEWPND= ****** GX	STOIMP= ****** GX	WRTLST  000716RG    002

E1      001602R     002	LSTBLK= ****** GX	OBJBLK= ****** GX	SYMCHR= 000012   	WRTOBJ  000120RG    002

E2      001644R     002	LSTBYT  000454RG    002	OBJBUF= ****** GX	SYMFLA= 000002   	WRTTTY  000414RG    002

FF    = 000014   	LSTCHA  000610RG    002	OBJBYT= ****** GX	SYMLEN= 000011   	XPC1  = ****** GX

FRMBUF= ****** GX	LSTLCT= ****** GX	OBJNAM  000216RG    002	SYMLIN= 000000   	XPC2  = ****** GX

FRMPTR= ****** GX	LSTLIN= ****** GX	OBJPSC  000210RG    002	SYMMAX= 000017   	XTAB    000540R     002

FRMTOP= ****** GX	LSTLND= ****** GX	OBJPTR= ****** GX	SYMSEG= 000010   	$DIDDO= 000000

F.NRBD= ****** GX	LSTLPT= ****** GX	OBJWRN= ****** GX	SYMVL1= 000004   	$E$   = 000001

GETERR  000100R     002	LSTXST= ****** GX	OUTOBJ  000264RG    002	SYMVL2= 000006   	$F$   = 000000

GETFRA  000000RG    002	LS.ME = ****** GX	PAR$$$= 000027   	S.ABS = 004000   	$I$   = 000001

HEADER  001342RG    002	LS.MEB= ****** GX	PC1   = ****** GX	S.ASN = 000200   	$L    = 000003

HEDSET  001564RG    002	L0      000060R     002	PC2   = ****** GX	S.DBG = 002000   	$LL   = 000001

IDENTP= ****** GX	L1      000300R     002	PSECCH= 000020   	S.DF  = 100000   	$L$   = 000000

IIII  = 177777   	L10     001642R     002	PSECOP= 000016   	S.EPT = 000100   	$O$   = 000000

INTQIO= ****** GX	L2      000334R     002	PSECV1= 000012   	S.EXTN= 010000   	$R    = 177777

INTRSB= ****** GX	L3      000360R     002	PSECV2= 000014   	S.GLOB= 020000   	$T    = 000011

LBLS0 = 000006   	L4      000412R     002	P.ERR = ****** GX	S.LOCL= 001000   	$T1   = 000000

LBLS1 = 000007   	L5      001552R     002	P2EMSG  000560RG    002	S.ODBG= 000040   	$T2   = 000006

LBLS2 = 000002   	L6      001644R     002	P2ERPT= ****** GX	S.REF = 000400   	$Y$   = 000000

LBLS3 = 000010   	L7      001644R     002	Q.IOPL= ****** GX	S.TKMS= 000377   	$Z$   = 000000

LF    = 000012   	MACLGT= ****** GX	RECTYP= ****** GX	S.WEAK= 040000   	$$T   = 000010

LFORM   000622RG    002	MAXWTH= ****** GX	RGTANG= 000076   	TAB   = 000011   	.PUTSQ= ****** G



. ABS.	000000	   000

      	000000	   001

P2IO  	001646	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  12549 WORDS  ( 50 PAGES)

DYNAMIC MEMORY:  14388 WORDS  ( 55 PAGES)

ELAPSED TIME:  00:01:51

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

