Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99g-bb - cmngen.c05
There are 2 other files named cmngen.c05 in the archive. Click here to see a list.
 REP 18/1	;05C1
	;V12A****************
	;JSM	19-Mar-81	[1123] Bad table link, catastrophe in phase E with
	;				subscript assoc with linkage item with no occurs clause.
 WIT
	;V12B****************
	;JEH	30-SEP-82	[1411] Test for leading truncation warning in the 
	;				rounding routine if converting from floating
	;				point to binary before operand sizes adjusted
	;JEH	18-MAY-82	[1355] Build COMP-3 zero literal correctly
	;JEH	05-MAY-82	[1353] Eliminate HALT if literal too large - give error
	;RJD	09-MAR-82	[1344] Bad code generated for literal compare 
	;JSM/DN	16-OCT-81	[1300] Fatal Diag for subprogram if REDEFINED item
	;			  is referenced in USING clause but original item
	;			  is referenced elsewhere.
	;JSM	18-SEP-81	[1307] Comp-3 Literal 0 always generated unsigned
	;				Make signed if receiving operand signed.
	;V12A****************
	;JSM	19-Mar-81	[1123] Bad table link, catastrophe in phase E with
	;				subscript assoc with linkage item with no boccurs clause.
 INS 8/2	;05C2
	EXTERNAL WARNAD			;[1411]
 REP 34/14	;05C3
	;	OCT	17
	;(COMP-3 ZERO PIC S9(18).)

	C3ZRO.::
		SKIPE	EACC,	C3ZERO##	;HAS IT ALREADY BEEN GENERATED?
		POPJ	PP,			;YES, RETURN.

		PUSH	PP,	[XWD	17,C3ZERO##]	;SET UP THE
 WIT
	;	OCT	17 ;[1307] ASSUMES UNSIGNED, SIGNED SHOULD BE OCT 14
	;(COMP-3 ZERO PIC 9(18) OR S9(18).)	;[1307]

	C3ZRO.::
	;[1307] GENERATE LITERAL SEPARATELY FOR EACH RECEIVING OPERAND, AS THERE
	;[1307] MAY BE A MIX OF SIGNED AND UNSIGNED RECEIVING OPERANDS.
	;[D1307] SKIPE	EACC,	C3ZERO##	;HAS IT ALREADY BEEN GENERATED?
	;[D1307] POPJ	PP,			;YES, RETURN.

		TSWF	FBSIGN	;[1307] If receiving operand is signed
		PUSH	PP,	[XWD	14,C3ZERO##] ;[1307] Make Literal signed
		TSWT	FBSIGN	;[1307] Else make it unsigned
		PUSH	PP,	[XWD	17,C3ZERO##]	;SET UP THE
		SETZ	EACC,				;[1355] ZERO FIRST PART OF LIT.
 REP 29/21	;05C4
		TRNE	TA,770000	;VERY LARGE LITERAL
		HALT			;YES
		HRRZ	TE,TA		;GET SIZE
 WIT
		TRNN	TA,770000	;[1353] VERY LARGE LITERAL?
		JRST	STASHR		;[1353]  NO
		MOVEI	DW,E.653	;[1353]  YES
		JRST	BADLIT		;[1353] GIVE ERROR
	;[1353]	HALT			;YES
	STASHR:	HRRZ	TE,TA		;[1353] GET SIZE
 REP 15/25	;05C5
		TRNE	TA,770000	;VERY LARGE LITERAL
		HALT			;YES
		HRRZ	TE,TA		;GET SIZE
 WIT
		TRNN	TA,770000	;[1353] VERY LARGE LITERAL?
		JRST	STASHK		;[1353]  NO
		MOVEI	DW,E.653	;[1353]  YES
		JRST	BADLIT		;[1353] GIVE ERROR
	;[1353]	HALT			;YES
	STASHK:	HRRZ	TE,TA		;[1353] GET SIZE
 INS 23/26	;05C6
		JUMPL	TE,[	PUSHJ	PP,XPNLIT	;[1344] IF RELATIVE PTR
				JRST	STSL1B]		;[1344] ALREADY SKIP PTR DEVEL. 
 INS 29/26	;05C7
	STSL1B:				;[1344]
 REP 13/40	;05C8
	ROUNDG:	MOVE	TE,[XWD ESIZEB,ESIZEA]
 WIT
	ROUNDG: MOVE	TE,ESIZEB	;[1411] CALCULATE DIFFERENCE IN DIGITS BEFORE
		SUB	TE,EDPLB	;[1411]  THE DECIMAL POINT BETWEEN RESULT FIELD
		ADD	TE,EDPLA	;[1411]  AND OPERANDS IN EXPRESSION
		SUB	TE,ESIZEA	;[1411] IF B OPERAND HAS SAME OR MORE, NO
		JUMPGE	TE,ROUNDH	;[1411]   LEADING TRUNCATION, SO CONTINUE
		MOVEI	TA,E.502	;[1411] ELSE GIVE WARNING
		MOVE	TE,CUREOP	;[1411]
		HRRZ	TE,1(TE)	;[1411]
		HRL	TA,TE		;[1411]
		PUSHJ	PP,WARNAD	;[1411]
	ROUNDH:				;[1411]
		MOVE	TE,[XWD ESIZEB,ESIZEA]
 REP 7/116	;05C9
		JUMPE	TB,SILG7C	;NO

	SILG7A:	MOVE	CH,[AD+ASINC,,AS.MSC]
		PUSHJ	PP,PUT.XA	;"ADD AC,"
		LDB	TB,DA.ARG##	;WHERE IS THE ARG?
		JUMPN	TB,SILG7B	; THERE IT IS!
 WIT
	;[D1300] JUMPE	TB,SILG7C	;NO
		MOVEM	TA,HLDBRO##	;[1300] INITIALIZE TEMP BROTHER PTR WITH SELF
		JUMPN	TB,SILG7A	;[1300] YES, REF'D BY ENTRY OR PD USING
		PUSH	PP,TA		;[1300] SAVE PTR TO CURRENT ITEM AGAIN
	SILG7D:				;[1300]
		LDB	TA,DA.BRO##	;[1300] SEE IF IT HAS A BROTHER
		JUMPE	TA,SILG7E	;[1300] NO, GIVE UP
		PUSHJ	PP,LNKSET	;[1300] GET POINTER TO IT
		LDB	TB,DA.RDF##	;[1300] IS IT A REDEFINES?
		JUMPE	TB,SILG7D	;[1300] NO, TRY TO GET NEXT BROTHER
		LDB	TB,DA.ARG##	;[1300] IS ITS INDEX LOC SET UP?
		JUMPE	TB,SILG7D	;[1300] NO, TRY TO GET NEXT BROTHER
		MOVEM	TA,HLDBRO##	;[1300] YES, PUT IN TEMP BROTHER PTR
		POP	PP,TA		;[1300] RESTORE PTR TO ORIG ITEM
					;[1300] AND CONTINUE ON TO GENERATE INSTR
	SILG7A:	MOVE	CH,[AD+ASINC,,AS.MSC]
		PUSHJ	PP,PUT.XA	;"ADD AC,"
	;[1300] HERE WE USE THE TEMP BROTHER PTR TO SEE IF INDEX LOC IS SET UP
		PUSH	PP,TA		;[1300] SAVE PTR TO CURRENT ITEM
		MOVE	TA,HLDBRO##	;[1300] GET PTR TO BROTHER (OR MAYBE SELF)
	;[1300] THEN WE GET HIS INDEX LOC. IF THIS IS SET UP WE USE IT TO GENERATRATE
	;[1300] THE SECOND OPERAND FOR THE INSTRUCTION. IF IT IS NOT SET UP WE
	;[1300] FALL THRU THE CODE AND PUT A 0 IN FOR THE SECOND OPERAND.
		LDB	TB,DA.ARG##	;WHERE IS THE ARG?
		POP	PP,TA		;[1300] RESTORE PTR TO CURRENT ITEM
		JUMPN	TB,SILG7B	; THERE IT IS! ;[1300] GENUINE ENTHUSIASM
 INS 23/116	;05C10
	SILG7E:	POP	PP,TA		;[1300] NO VALID BRO, SO RESTORE ORIG PTR
					;[1300] AND FALL THRU TO REPORT ERROR.
 SUM 10947