Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/comp/i2.mac
There are 2 other files named i2.mac in the archive. Click here to see a list.
;<MENDERIN>I2.MAC.5, 15-Jan-77 11:54:43, Edit by ENDERIN
	COMMENT/

VERSION		4 [14,16,43,225,260]

AUTHOR		STEFAN ARNBORG

CONTENTS:	INITIALIZATION, APR, REENTER AND START ROUTINES
/
	SEARCH	SIMMAC,SIMMC2,SIMMCR
	SALL
	CTITLE	I2
	TWOSEG
		edit(225)
	TOPS10,<;[225]
	LOC	<.JBVER==137>
	EXP	VERCOM
	>
	MACINIT
	RELOC	400K
	EXTERN	CAEN,O2CF,O2IS,O2OP,M2EN,M2UU,YSTK,YOPST
	EXTERN .JB41,.JBDDT,.JBAPR,.JBREN,.JBSA
	IFN QDEBUG,<EXTERN YP2IN>
	EXTERN	O2AB
				edit(14)
	EXTERN	CGIACT		;[14]
	EXTERN	Y1LOWE,YDCSTO,YCGXAC
	EXTERN	YO2IQB,YO2IQI
				edit(43)
	EXTERN	YO2CIQ		;[43] CURRENT IQ BUFFER POINTER
	EXTERN	YO2ITB		;[43] SECOND IQ BUFFER
	EXTERN	YOPSTP,YELIN2,YERRCT
	EXTERN	QOPSTZ,YMAXID,YMAXFX,YBKSTP,YBREAK,YDCSTB,YDCSTP,YEXPL,YEXPP,YRELCN
	EXTERN	YFXTAB,YGAP,YO2CDB,YO2CDP,YO2LIR,YO2LTB,YO2LTP,YO2PTB,YO2PTP,YO2STB
	EXTERN	YO2STP,YQRELR,YQRELT,YRDSTB,YRDSTP
	EXTERN	YACTAB,YQREL
	EXTERN	YM2EWS,YERRCT,YWARCT
	EXTERN	.JBTPC,.JBCNI
	EXTERN	YELIN1
	INTERN	I2EN


	EXTERN YPASSNO	;[225]
	edit(260)
	CAI		;[260] PASS2 must be at 4000011
PASS2:	PORTAL	I2EN	;[260]

I2AP:	L	17,[-QSTSIZ,,YSTK]
	L	X1,[ASCIZ/2/]
	L	.JBCNI	; PROCESSOR CONDITIONS
	IF	TRZN	AP.POV
		GOTO	FALSE
	THEN	; STACK OVERFLOW
		SETON	YSWP1	; TO PRODUCE LIST IN PASS 3
		SETZM	YELIN2
		ERRT	QT,Q.OFL
		BRANCH	O2AB
	FI
	ASSERT <RFAIL	PROGRAM INTERRUPT>
	SKIPE	YERRCT
	BRANCH	O2AB
	OUTSTR	[ASCIZ/
Program interrupt/]

			edit(16)
I2REN:	PORTAL	.+1	;[16] PORTAL for concealed mode
	MOVSI	X3,1
	IFE QDEC20,<;[225]
	IFG	QTRACE,<EXTERN	YTRPAS
	EXTERN	TRACE
	IFON	YTRSW
	HRRI	X3,0
	>
	SWAPPA(SIMP3,S3,-1,QP3PPN)
I2START:PORTAL	.+1	;[16] PORTAL for concealed mode
	MOVSI	X3,1
	SWAPPA(SIMULA,S1,0,QP1PPN)
	>
	edit(225)
TOPS20,<BRANCH	I3##;[225]
I2START:PORTAL	SIMULA##
>
I2EN:	ASSERT<
	SKIPN	YMAXID
	RFAIL	LOW SEGMENT MISMATCH
	>
		SETZB	X0,XPDP
	ASSERT<EXEC	YP2IN
		>
IFG QTRACE,<
		SKIPE	X1,TRACE
		JSP	16,TRACE	; CHECK FOR TRACE IF NOT UNRESOLVED
>
	LI	2	;[225]
	ST	YPASSNO	;[225]
	LI	I2REN
	HRRM	.JBREN
	LI	I2START
	HRRM	.JBSA
	LI	I2AP
	HRRM	.JBAPR
	AP.POV=200K	; PUSHDOWN OVERFLOW
	AP.ILM=20K	; ILLEGAL MEMORY
	AP.NXM=10K	; NONEXISTENT MEMORY
	LI	<AP.POV+AP.ILM+AP.NXM>
	APRENB	X0,
	; SET UP PD-STACK
	L	XPDP,[-QSTSIZ,,YSTK-1]
	ASSERT<; SET STACK UNDERFLOW ROUTINE
		LI	[SETZM	YELIN2
			L	X1,[ASCIZ/2/]
			ERRT	QT,Q.UFL	; STACK UNDERFLOW MSG
			BRANCH	O2AB
			]
		LI	X1,10
		STACK
		SOJG	X1,.-1
	>
	L	[PUSHJ	XPDP,M2UU]
	ST	.JB41
	JFCL	17,.+1	; RESET FLAGS
; INITIALIZE THE DATA STRUCTURES OF PASS 2
; THE INITIALIZATIONS NECESSARY TO COMPUTE THE
; REQUIRED CORE SIZE WERE MADE IN PASS 1

	; ERROR COUNTS
	L	YWARCT
	ADD	YERRCT
	ST	YM2EWS

	; REDECLARATION STACK
	L	YRDSTB
	ST	YRDSTP
	SUB	YDCSTB
	HRLM	YRDSTP
	LI	777770
	ANDM	YDCSTO	; ALWAYS KEEP 7 ADDRESSABLE WORDS ABOVE YDCSTO
	; OPERAND STACK
	L	[QOPSTZ,,YOPST-1]
	ST	YOPSTP
	LI	YOPST
	SUBI	QOPSTZ
	HRRZM	YEXPP
	HRRZM	YEXPL
	; I/O POINTERS AND BUFFERS
	LI	QRELCD
	ST	YQRELT
	LI	QRELCD
	ST	YGAP
	LI	QRELCD
	ST	YQREL
	LI	QRELCN
	ST	YQRELR

	; CODE STREAM PARAMETER BLOCKS AND BUFFERS

	L	X0,[1013,,QBUFS-4]	;HEADER WORD
	HRLI	X1,200K			;RELOC. BYTE START ADDRESS
	SETZ	X2,			;START ADDRESS =0

	STD	X0,YO2CDB		;CODE STREAM
	LI	X3,QRELCD
	SF	X3,ZQRER(,X2)		;RELOC CODE START ADDRESS
	ST	X2,YO2CDB+2

	STD	X0,YO2PTB		;PROTOTYPE STREAM
	LI	X3,QRELPT
	SF	X3,ZQRER(,X2)
	ST	X2,YO2PTB+2

	HRLI	X0,1015			; ITEM TYPE 1015
	STD	X0,YO2LTB		;LINE NUMBER TABLE
	LI	X3,QRELLT
	SF	X3,ZQRER(,X2)
	ST	X2,YO2LTB+2

	HRLI	X0,1014			;ITEM TYPE 1014
	STD	X0,YO2STB		;SYMBOL TABLE
	LI	X3,QRELST
	SF	X3,ZQRER(,X2)
	ST	X2,YO2STB+2


	HRLI	X0,4400			;BUFFER BYTE POINTER
					; = POINT	36,YO2??B+2,35
	LI	X1,QBUFS-5		;COUNTER
	HRLI	X2,420200		;RELOCATION BYTE POINTER
					; = POINT 2,YO2??B+1,1
	LI	X3,^D18			;RELOCATION GROUP COUNTER

				;CODE STREAM
	HRRI	X0,YO2CDB+2		;ADDRESS PART OF BUFFER POINTER
	HRRI	X2,YO2CDB+1		;ADDRESS PART OF RELOC. POINTER
	STD	X0,YO2CDP		;BUFFER POINTER AND COUNTER
	STD	X2,YO2CDP+2		;RELOC. POINTER AND COUNTER

				;PROTOTYPE STREAM
	HRRI	X0,YO2PTB+2
	HRRI	X2,YO2PTB+1
	STD	X0,YO2PTP
	STD	X2,YO2PTP+2

				;LINE NUMBER TABLE
	HRRI	X0,YO2LTB+2
	HRRI	X2,YO2LTB+1
	STD	X0,YO2LTP
	STD	X2,YO2LTP+2

				;SYMBOL TABLE
	HRRI	X0,YO2STB+2
	HRRI	X2,YO2STB+1
	STD	X0,YO2STP
	STD	X2,YO2STP+2


	L	[XWD	10,0]
	ST	YO2IQB
	ST	YO2ITB		;[43]
	LI	2
	ST	YO2IQI
	LI	YO2IQB	;[43]
	ST	YO2CIQ	;[43] START WITH YO2IQB
	L	YBREAK
	ST	YRELCN
	ST	YO2LIR
	L	X2,YMAXFX
	AOS	X2
	L	X1,YFXTAB
	LI	QB
	WHILE
		SOJL	X2,FALSE
	DO
		SF	,ZFXTYP(X1)
		AOS	X1
	OD
	; ACCUMULATOR TABLE

	EXEC	CGIACT		;[14] INITIATE YACTAB, YTAC, YCGXAC

	; CHAIN FREE FIXUPS
	L	X3,YRDSTB
	SUB	X3,YFXTAB
	SOS	X3
	WHILE	SOS	X3
		CAMG	X3,YMAXFX
		GOTO	FALSE
	DO
		L	X1,X3
		EXEC	O2CF
	OD
	; SET UP DUMMY ENVIRONMENT IN BLOCK STACK
	L	X1,YBKSTP
	PUSH	X1,YDCSTP
	ST	X1,YBKSTP
	EXEC	O2OP	; SET UP FILES
	EXEC	O2IS
	ASSERT<
		CAIE	XCUR,%BPROG
		RFAIL	IC1 DOES NOT START WITH BPROG
	>
	SETZM	YELIN1
	SETZM	YELIN2
	EXEC	CAEN
	EXEC	M2EN
	FATAL	7,STACK UNDERFLOW
IFN QDEC20,<END>;[225] NO START ADDRESS HERE IF SINGLE SEGMENT
	END	PASS2	;[260]