
/4TRAN INSTRUCTION GENERATOR ROUTINE

IGROU,	DZM #OVSYM
	XCT TOP
	SPA!RAL		/BIT 0 IS "COMMUTE" BIT
	COMMUTE
	SPA		/BIT 1 IS "LAC-1" BIT
	LC1

ALIG,	LAC #FOFFF
	RAR		/+0 IS FIXED, -0 FLOATING, OTHER NONDET
	XCT TOP
	AND (17
	RAL
	SAD (1
	LC1
	ADD (LAC OPTAB
	DAC . 1
	XX
	DAC ALWORD

ALLOOP,	LAM -2
	DAC #ALCOUT
	LAW DTABIG-2
	DAC AUTOG0
ALWORD,	XX
	ISZ .-1
	RAL6
	DAC #ALTEM4
	RAL
	AND (77
	DAC DTABT
	ISZ AUTOG0
	SAD I AUTOG0
	JMP I AUTOG0
	JMP .-3

/DISPATCH ON IG CODES

DTABIG,	34	JMP UNSETM
	12	JMP EQUAS
	35	JMP IFOO2
	75	JMP IFOO
	76	JMP IFOO
	13	JMP ALDONE
	32	JMP ALWOR0
	15	JMP ALARG2
	14	JMP ALARG1
	33	JMP ALARGM
	37	JMP IFTEMZ
	16	JMP OVRUND
	17	JMP ALARG3
DTABT,	0


ALRETR,	PUNCHW
ALRETU,	ISZ ALCOUT
	SKP
	JMP ALLOOP
	LAW DTABIG-2
	DAC AUTOG0
	LAC A#LTEM4
	JMP ALWORD+2

IFOO2,	LAC (74
IFOO,	ADD (-73
	ADD TOP
	DAC ALTEM3
	PUNPER
	XCT ALTEM3
	PUNDCC
	JMP ALRETU

UNSETM,	CLC
	DAC FOFFF
	LAW 36
	JMP ALRETR

NOTHER,	LAC I ALTEM3
	AND (DAC
	CLC!SNA
	CLA
	JMP MODEA1

OVRUND,	CAL .+2
	JMP ALRETU
	OVFOO
	JMP NOTHER
	LAC I ALTEM3
	FUNQUR
	MODEA1

OVRET,	LAC I ALTEM3
	DAC ALTEM3
	LAC I #ALTEM3
	DAC COMMON
	ISZ ALTEM3
	LAC I ALTEM3
	DAC COMMON+1
OVMID,	LAC TYPE4
	SEARCH
	SKP
	EXIT
	LAC TYPE1
	SEARCH
	SKP
	EXIT
	LAC COMMON
	AND (770000
	SAD (730000
	EXIT
	FIXFLO
	CLA!SKP
	LAC (602414		/(UC-UNDERBAR-LC)-(141456)
	ADD (141456
	DAC OVSYM
	EXIT

OVFIX,	CLA
	SAD FOFFF
	EXIT2
	PUNTAB
	LAC PARA+1
	PUNCH3
	CLA
	JMP PFC

PUNTAB,	LAW 36
	JMP PUNCHW

PFIXI,	PUNTAB
	LAC PARA+2
	PUNCH3
	CLC
PFC,	DAC FOFFF
	PUNCRR
	EXIT2

ALDONE,	LAM -1
	ADD TOP
	DAC IT
	DAC ACIND
	DZM I ACIND
	SAD (LAC I POLISH
	SKP
	DZM I IT
	EXIT

ALARGM,	LAM -1
	SKP

ALARG3,	LAC (3
	SKP

ALARG2,	LAC (1
	SKP

ALARG1,	LAC (2
	ADD TOP
	PVAR
	JMP ALRETU

COMMUTE,	LAC TOP
	DAC #ALTEM1
	ISZ ALTEM1
	LAC I ALTEM1
	SZA!CMA
	EXITR
	TAD TOP
	DAC ACIND
	LAC I ACIND
	DAC I ALTEM1
	DZM I ACIND
	EXITR

LC1,	DAC #LCTEMX
	LAM -1
	ADD TOP
	DAC ALTEM1
	LAC I ALTEM1
	SNA
	JMP LCXIT
	ACINUT
	LAC I ALTEM1
	AND (TAD
	SAD (LAC
	SKP!CLA
	SAD (XOR
	JMP STLC2
	SAD (JMS
	CLA!SKP
	SAD (DZM
	JMP STLC2
	LAC I ALTEM1
	AND (ADD
	SAD (ADD
	SKP!CLC
	SETLC1
LC4,	CMA
	MODES-1
	LAC (FLEX 	LA
	PUNCH3
	PULAC
	LAC ALTEM1
	PVAR
	LAC ALTEM1
	DAC ACIND
	DZM I ALTEM1
LCXIT,	LAC LCTEMX
	EXIT

STLC2,	SZA!CMA
	CLA
	JMP LC4

PULAC,	LAC (FLEX C  
	JMP PUNCH2

ACINUT,	LAC ACIND
	SNA
	EXIT

ACINU,	SETSAV
	DAC I ACIND
	LAC (FLEX 	DA
	PUNCH3
	PULAC
	LAC ACIND
	DZM ACIND
	JMP PVAR

SETSAV,	DSPARA
	LAC FOFFF
	AND (40000
	ADD (100000
	ADD #NUMTEM
	XCT PARA+1

SETSE2,	LAC FOFFF
	AND (1
	XCT WSIZE
	RCL

SETSET,	ADD (1
	ADD NUMTEM
	DAC NUMTEM
	ADD #NUMAX
	SPA!CLL
	STL
	LAC NUMTEM
	SNL!CMA
	DAC NUMAX
	EXIT1

PVAR,	DAC ALTEM3
	LAC I ALTEM3
	DAC #PVART
	DAC #INDIND
	RAL4
	AND (3
	DSPTCH

PDIST,	JMP PVAR0
	JMP PVAR1
	JMP PVAR2
PVAR3,	LAC I PVART
	DAC COMMON
	LAW PARMES-1
	JMP PUNDCR

PARMES,	TEXT .(.

EXTPUN,	LAW EXTMES-1
	PUNSYC
	JMP PUNCRR

PVAR0,	LAC I PVART
	DAC COMMON
	ISZ PVART
	ISZ ALTEM3
	LAC I PVART
	DAC COMMON+1
	LAC I ALTEM3
	SAD (CMT UNOP1
	SKP
	JMP PVARC
	DZM I ALTEM3
	LAC FOFFF
	DAC #OLDMOD
	DUMSYM
	JMP PVARR2
	LAC TYPE1
	SEARCH
	SKP
	JMP PVARR
	LAW 2
	INSERT
	LAC TYPE3
	JMP PVARR
	EXTPUN

PVARR,	FUNXF
	CMA
	DAC FOFFF#1
PVARR2,	DZM OVSYM
	LAW MESCAL-1
	PUNSTR
	PUNMUC
	LAM -1
	ADD ALTEM3
	DAC ALTEM4
	DAC #TEMIND
	LAC FOFFF1
	AND (40000
	ADD (LAC I FOFFF1
	DAC I TEMIND
	LAC TYPE3
	SEARCH
	CLA!SKP
	CLC
	AND (10000
	XOR I TEMIND
	DAC I TEMIND

PVARL,	LAC ALTEM3
	DAC AUTOG1
PVARL2,	LAC I AUTOG1
	SPA
	JMP PVARQ
	DAC #ALTEM4
	AND (ADD
	SAD (ADD
	JMP CONVAR
	LAC ALTEM4
	AND (700000
	SZA
	JMP MODTOT
	LAC ALTEM4
	SETLC1+1
	CMA
	AND (CHAR LF-CHAR LX
PRETF1,	ADD (CHAR LX
	DAC #FIXVAR
PRETF,	LAC (FLEX 	AR
	PUNCH3
	LAC FIXVAR
	PUNCH2
	LAC ALTEM4
	OVRET+1
	LAC ALTEM4
	PVAR+2
	JMP PVARL2

CONVAR,	CLA
	JMP PRETF1

MODTOT,	LAC ALTEM4
	AND (40000
	SZA!CLC
	JMP PRETF1-1
	JMP PRETF1

MESCAL,	TEXT .	CAL .

IFTEMZ,	DZM COMMON
	DZM COMMON+1
	DZM COMMON+2
	PUNPER
	FLCONS
	PUNCH3
	JMP ALRETU

SETLC1,	LAC I ALTEM1
	DAC #STEMP
	LAC I STEMP
	DAC COMMON
	ISZ STEMP
	LAC I STEMP
	DAC COMMON+1
FUNXF,	FIXFLO
	CLC!SKP
	CLA
	EXIT

PUNIND,	LAC #INDUM
	SZA
	JMP PUNCH2
	EXIT

DUMSYM,	DZM INDUM
	XCT SWITCH
	EXIT1
	LAC TYPE0
	SEARCH
	EXIT1
	DZM OVSYM
	LAC TYPE5
	SEARCH
	JMP DUMIND
DUMSY2,	ADD (3
	DAC SEARCC
	FIXFLO
	CLA!SKP
	CLC
	DAC FOFFF1
	LAC I SEARCC
	DAC COMMON+1
	LAC (141473
	DAC COMMON
	EXIT

DUMIND,	LAC (CHAR LI
	DAC INDUM
	EXIT

PVARC,	TESTFU
	DUMSYM
	NOP

PUNMUC,	PUNIND
	LAC OVSYM
	SZA
	PUNCH3
	PUNSYM
	JMP PUNCRR

PVAR1,	LAC INDIND
	AND (I
	SZA!CLL
	STL
	LAC (FLEX I  
	SZL
	PUNCH2
	LAC PVART
	AND (7777
	DAC COMMON
	LAW TEMME2-1
	JMP PUNDCR

PVAR2,	DZM TEMIND
	LAW TEMADM-1
	JMP PUNSTR

TEMADM,	TEXT .I TEMAD
.

SETMODE,	DSPARA
	FIXFLO
	JMP OVFIX
	CLC
	SAD FOFFF
	EXIT2
	JMP PFIXI

EXPON,	ISZ EXPCOT
	JMP IGROU3
	LAW EXPMES-1
	PUNSTR
IGROU3,	LAM -1
	ADD TOP
	DAC ALTEM1
	ADD (2
	DAC #ALTEM2
	MIXMODE
	DAC ALTEM4
	LAC ALTEM2
	DAC ALTEM1
	MIXMODE
	XOR ALTEM4
	SZA
	JMP MIXEXP
	LAC ALTEM4
	SAD FOFFF
	JMP IGROU2
	ACINUT
	LAC ALTEM4
	MODES-1
	JMP IGROU2

EXPMES,	TEXT .
	EXTERNAL XPN,EXP

.

MIXMODE,	LAC I ALTEM1
	SZA
	JMP .+3
	LAC FOFFF
	EXIT
	AND NOPER
	SNA
	JMP .+5
	AND (40000
	SZA
	CLC
	EXIT
	LAC I ALTEM1
FUNQUR,	DAC ALTEM1
	LAC I ALTEM1
	DAC COMMON
	ISZ ALTEM1
	LAC I ALTEM1
	DAC COMMON+1
	FUNXF
	CMA
	EXIT

ALGORI,	DAC #NEWOPI
	LAC VARS
	SZA!CLL
	STL
	DZM VARS
	LAC NEWOPI
	SAD (ADDOP
	JMP ALO1
	SAD (SUBOP
	JMP ALO2
	SAD (UNOPEN
	JMP ALO3
	SAD (CLOSEO
	JMP ALO4
	SAD (CRTURN
	JMP ALO4+1
	SNL
	HELP 707 EI
	JMP ALO4+1
ALO1,	CLA!SKP
ALO2,	LAC (UNSUB
	SKP
ALO3,	LAC (OPENOP
	SNL
	DAC NEWOPI
	SKP
ALO4,	ISZ VARS
	LAC NEWOPI
	SNA
	EXIT
	LAC I NEWOPI
	AND (1700
	CMA

NEWOPL,	DAC NEWOP

NEWOPT,	XCT TOP
	AND (1700
	ADD #NEWOP
	ADD (1
	SMA
	JMP PROD

NEWOPR,	LAC N#EWOPI
	SAD (COMOP
	EXIT
	ISZ IT
	XOR (XCT
	DAC I IT
	LAC (LAC I-LAW
	ADD IT
	DAC TOP
	EXIT

PROD,	LAC I TOP
	DAC ALTEM1
	ISZ ALTEM1
	LAC I ALTEM1
	DAC ALTEM1
	SMA
	JMP I ALTEM1
	DAC I TOP
	JMP NEWOPT

CERR,	HELP 717 EI

OVFOO,	LAM -1
	ADD TOP
	DAC ALTEM3
OVFOO2,	LAC I ALTEM3
	AND (ADD
	SZA
	EXIT
	EXIT1

TESTFU,	LAC COMMON
	SAD NAME
	SKP
	EXIT
	LAC COMMON+1
	SAD NAME+1
	SKP
	EXIT
	XCT FUNSWT
	HELP IFU 1
	LAC (FLEX RES
	DAC COMMON
	LAC (141414
	DAC COMMON+1
	EXIT

IFU=EI 1500

UNOP,	ACINUT
	LAC I TOP
	DAC ALTEM2
	ISZ TOP
	LAC TOP
	DAC ALTEM1
	LAC I TOP
	ISZ ALTEM1
	DAC I ALTEM1
	LAC ALTEM2
	DAC I TOP
	MIXMODE
	MODES-1
	IGROU
	POPTOP
	JMP NEWOPT

PAREN,	LAC TOP
	DAC #ALTEM7
	ADD (2
	DAC TOP
	LC1
	LAC ALTEM7
	ADD (1
	ADD (-1
	DAC TOP
	DAC ALTEM7
	LAC I ALTEM7
	SPA
	JMP BIFOP
	LAC ALTEM7
	JMP .-7
BIFOP,	LAC TOP
	DZM I TOP
	DAC ACIND
	ADD (1
	JMP POPTOP+1

IFROU,	LAC TOP
	DAC ALTEM1
	ISZ ALTEM1
	LAC I ALTEM1
	DAC ALTEM3
	LAC I TOP
	DAC I ALTEM1
	LAC ALTEM3
	DAC I TOP
	ISZ TOP
	LAC TOP
	DAC ALTEM3
	ADD (3
	DAC ALTEM1
	ISZ ALTEM3
	XCT ALTEM3
	DAC ALTEM3
	XCT ALTEM1
	SAD ALTEM3
	JMP SPIF

IGROU2,	IGROU
	POPTOP
	JMP NEWOPT

SAVARG,	LAC I IT
	SNA
	JMP ACINU
	EXIT

PVARQ,	LAC OLDMOD
	DAC FOFFF
	EXIT

SPIF,	LAC (XCT IFOPZ
	DAC I TOP
	JMP IGROU2

OPARG,	LAC NEWOPI
	SAD (COMOP
	JMP SAVARG
	SAD (CLOSEO
	SKP
	JMP NEWOPR
	SAVARG
	LAC TEMIND
	SZA
	SAVTEM
	ISZ IT
	CLC
	DAC I IT
	TAD TOP
	PVAR
	JMP POPTOP

MIXEXP,	ACINUT
	LAC TOP
	DAC #ALTEM5
	LAC ALTEM4
	SNA
	JMP EASY
	ISZ TOP
	ISZ TOP
EASY,	LC1
	LAC ALTEM5
	DAC TOP
	CLC
	MODEA1
	JMP IGROU2

SAVTEM,	ACINUT
	LAC I TEMIND
	AND (DAC 10000
	ADD (JMS
	ADD NUMTEM
	DAC I TEMIND
	LAC NUMTEM
	DAC #TEMNUM
	LAC I TEMIND
	AND (10000
	SNA
	JMP DSAV
	LAC I TEMIND
	AND (DAC
	SZA
	CLC
	MODES-1
	SETSE2
NOPER,	NOP
	LAW SETMES-1
	DAC #TTEM
	LAC TEMNUM
	DAC COMMON
	LAC TTEM
	DZM TEMIND
PUNDCR,	PUNSTD
	JMP PUNCRR

DSAV,	SETFIX
	SETSE2
	NOP
	LAC (I
	ADD I TEMIND
	DAC I TEMIND
	LAW SETME3-1
	JMP NOPER+2

SETME3,	TEXT /	LAC TEMAD
	DAC TEM+/


ALWOR0,	LAC (1
	LC1+2
	JMP ALRETU

EQUAS,	LAM -1
	ADD TOP
	DAC ALTEM1
	LAC I ALTEM1
	AND (700000
	SNA
	JMP EQUAS2
	LAC I ALTEM1
	AND (DAC
	SZA!CLC
	CLA
	JMP .+3
EQUAS2,	LAC I ALTEM1
	SETLC1+1
	CMA
	MODEA1
	JMP ALRETU

SETMES,	TEXT /	LAC I TEMAD
	DAC TEM+/

EXTMES,	TEXT /
	EXTERNAL /

MODEA1,	DAC COMMON
MODEA,	SETMOD
	FLEX FXA
	FLEX FLO
	EXIT

SETFIX,	CLA
	DAC COMMON
MODES,	SETMOD
	FLEX LFM
	FLEX EFM
	EXIT
ADDOP,	CMT LV5 OPADD	IGROU3
SUBOP,	NLC LV5 OPSUB	IGROU3
MULOP,	CMT LV6 OPMUL	IGROU3
DIVOP,	LV6 OPDIV	IGROU3
EQUOP,	LV5		XCT EQUOP1
EQUOP1,	NLC LV3 OPEQUX	IGROU2
EXPOP,	LV7 OPEXP	EXPON
OPENOP,	LV11		XCT OPENOX
OPENOX,	NLC LV2 OPOPEN	PAREN
CLOSEO,	LV1 OPCLOSE	CERR
IFOP,	LV1 OPIF		IFROU
COMOP,	LV2		0
DOOP,	LV1 OPDO		IGROU3
UNOPEN,	NLC LV11 OPOPP	XCT UNOP1
DOOP1,	LV1 OPDO1	IGROU3
UNOP1,	NLC LV4 OPOPP	OPARG
UNSUB,	NLC LV10 UNSUBOP	UNOP
ULOAD,	LV1 ULODOP	UNOP
IFOPZ,	LV1 OPIFZ	0

FOFFF1,	0
START

