Google
 

Trailing-Edge - PDP-10 Archives - bb-jr93j-bb - 7,6/ap013/xpand.c13
There are 10 other files named xpand.c13 in the archive. Click here to see a list.
 INS 22/1	;13C1
	;MJC	 4-NOV-85	[1613] Check for table overflow
 REP 33/2	;13C2
	XPAND1:	MOVE	TE,SAVEAC	;ANY TABLES ABOVE THIS ONE?
 WIT
	;[1613]CHECK FOR TABLE OVERFLOW

	XPAND1:	HRRZ	TA,SAVEAC	;[1613]GET TABLE POINTER
		HLRZ	TE,SAVEAC	;[1613]AMOUNT OF GROTH
		ADD	TE,1(TA)	;[1613]TABLE WILL GROW TO THIS SIZE
		HRRZ	TD,(TA)		;[1613]THE START OF THE TABLE
		HRRZ	TE,TE		;[1613]RIGHT HALF ONLY
		SUB	TE,TD		;[1613]LESS THE START ADDRESS
		MOVE	TD,TE		;[1613]SAVE THE DIFFERENCE
		ANDI	TE,700000	;[1613]MORE THAN 15 BITS?
		CAIN	TE,0		;[1613]OVERFLOW IF SO
		JRST	XPAND6		;[1613]OK - NO TABLE OVERFLOW

	;[1613]SEE IF WE CAN EXPAND ONE LAST TIME BY SOME SMALLER AMOUNT

		ANDI	TD,77777	;[1613]THE AMOUNT OF OVERLAP
		HLRZ	TE,SAVEAC	;[1613]EXPANSION WANTED
		SUB	TE,TD		;[1613]WHAT WILL FIT
		HLRE	TD,1(TA)	;[1613]LEFT UNUSED FROM LAST EXPANSION
		ADD	TE,TD		;[1613]INCLUDE IT TOO
		SOS	TE		;[1613]OFF BY ONE
		CAIG	TE,20		;[1613]ENOUGH TO SALVAGE?
		JRST	TBLOVF		;[1613]NO - GIVE UP
		HRLM	TE,SAVEAC	;[1613]YES - EXPAND BY THAT MUCH
		JRST	XPAND6		;[1613]CONTINUE WITH A SMALLER EXPANSION

	TBLOVF:	OUTSTR	[ASCIZ /?Compiler table overflow. Compilation aborted. 
	/]	;[1613]
		JRST	RESTRT		;[1613]ABORT AND RESTART

	XPAND6:	MOVE	TE,SAVEAC	;[1613]ANY TABLES ABOVE THIS ONE?
 SUM 2835