	.TITLE  REAL FLOATING POINT 
	.GLOBL .AH,.AP,.AO,.AG,.AI,.AR
	.GLOBL .AK,.AT,.AQ,.AL,.AU,.AM
	.GLOBL .BA,.AA,.AB,.AC,.AW,.AX
	.GLOBL .AJ,.AS,.AV,.AN,.CB,.ER
	.GLOBL .RB,.FS,.CH,.CD,.ZS
	.GLOBL .CI,.CE,.T1,.SET,.CC,.CA
	.GLOBL .A4,.HS,.HX,.MF
	.GLOBL .APH,.XCH
	/.AH-STORE SINGLE PRECISION
.AH	CAL	0
	LAC*	.AH
	JMS	.CB	/CLEARS LINK
	JMS	.ZRSN	/CHECK FOR 0
	LAC	.AA
	DAC*	CE14	/SAVE EX
	SZL
	JMP	AH01	/0 RESULT
	LAC	.AC
	TAD	REAL02	/ROUND BIT
	AND	REAL04	/EXTRACT LO
	DAC	T2	/SAVE LO
	GLK
	TAD	.AB
	SNA		/=0?
	TAD	(600000	/YES
	SAD	CN01	/=400000?
	JMP	.-2	/YES
/IF ARITH OV L=1,A=200000 IF+,A=600000 IF-
	DAC	T1	/SAVE HI
	GLK		/0 IF NO OV
	TAD*	CE14	/CHECK EX
	TAD	(377400	/FOR OV
	SZL		/& UNF
	JMP	OVF	/L=1,A0=0
	TAD	(1000
	SNL!CLL
	JMP	UNF	/L=0,A0=1
	XOR	T2	/ADD LO
	XOR	REAL02	/CHANGE SIGN
	DAC*	CE14	/STORE LO-EX
	LAC	T1
AH01	ISZ	CE14
	DAC*	CE14	/STORE HI
	JMP*	.AH
OVF	JMS*	.ER
	400001
	JMP	.	/IDLE
UNF	JMS*	.ER
	400002
	CLA!STL		/CREATE 0
	JMP	.AH+5
/
	/.AP-STORE DOUBLE PRECISION
.AP	CAL	0
	LAC*	.AP
	JMS	.CB	/GET ARG
	JMS	.ZRSN	/CHECK FOR 0
	LAC	.AA
	SNL
	XOR	CN01	/REMOVE BIAS
	DAC*	CE14	/STORE EX
	ISZ	CE14
	LAC	.AB
	DAC*	CE14	/STORE HI
	ISZ	CE14
	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	LMQ
	GLK
	TAD	.AC	/NEW NUM.
	LRS	2	/AVOID OVF
	JMS	DIVR	/Q2
	DAC	.A4	/R2
	LACQ
	DAC	.AC	/Q2
	MUL
CI02	CAL	0	/Q2*D2'
	TAD	.A4	/R2+Q2*D2'
	LRS	2	/AVOID OVF
	JMS	DIVR	/Q3
	641604		/CLA+LLS4
	DAC	T1
	LACQ		/SHIFTED Q3
	DAC	.A4
	LAC	.AC
	LMQ		/Q2 TO MQ
	641602		/CLA+LLS2
	TAD	.AB
	DAC	.AB	/HI QUOTIENT
	LACQ
	TAD	T1	/Q2+Q3
	DAC	.AC	/LO QUOTIENT
	SZL!CLL
	ISZ	.AB
	LAC	(377776	/BIAS
	JMS	ADN	/+ .AA EXT
	CMA
	DAC	.AAG
	LAC	.AA
	CMA
	DAC	.AA
	JMS	FINI
	JMP*	.CI
FAULT	JMS*	.ER	/0 OR UNORM
	400003		/DIVISOR--OTS 3
	JMP	.	/IDLE
DIVR	CAL	0
	DIV
CI03	CAL	0
	JMP*	DIVR
/
	/ CONSTANTS-WORKING STORE
.MF	0	/MULTI-PREC FLAG
.AAG	0	/.AA EXTEN
.AA	0	/FAC
.AB	0
.AC	0
.A4	0	/GUARD WORD
.A5	0	/2ND GUARD WORD
CE01	0	/HAC
CE02	0
CE03	0
.FS	0	/FAC SIGN
.HS	0	/HAC SIGN
.CE	0	/COMBINED SIGN
CE14	0	/OPERAND ADDRESS
.T1	0	/TEMP STORE
	0
	0
NORS	0	/NO RESIDUE INDICATOR
REAL02	400
REAL03	777
REAL04	777000
REAL05	377400
CN01	400000
CN02	377777
CN03	1
.HX=CE01
CE05=.FS
CEHS=.HS
TP1=.T1
/
	/MULT ROUTINE-.CA
.CA	XX
	LAC	.AC
	DAC	CA01
	DAC	CA02
	LAC	.AB
	DAC	CA03
	DAC	CA04
	CLL
	LAC	CE03
	MUL		/LO*LO
CA01	CAL	0
	DAC	.A4
	LACQ
	DAC	.A5
	LAC	CE02
	MUL		/HI*HI
CA03	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	LAC	CE02	/CHECK FOR UN
	SPA
	JMP	CH03	/UN
	LAC	.A4	/R-SHIFT 1
	RCR
	DAC	CE02
	LAC	.A5
	RAR
	DAC	CE03
	SAD	CE02	/ZERO TEST
	SZA
	SKP
CH03	JMS	RS0	/0 TO HAC
CH04	DZM	.RB
	JMP*	.CH
/
.NORD	XX
	JMS	.CD	/NORMALIZE
	JMS	.CH	/ROUND
	JMS	.ZRSN	/PACK SIGN
	SNL!CLC		/SKIP IF = 0
	LAC	.AAG	/OV-UN TEST
	SAD	M1
	JMP	.UN+3	/OK IF -1
	SMA!CLA
	JMP	.OV	/OV IF +
.UN	JMS*	.ER	/UN IF < -1
	400002
	JMS	.AW	/FLOAT 0
	LAC	.AB
	JMP*	.NORD
.OV	JMS*	.ER
OTS1	400001
	JMP	.	/IDLE
/
	/ADN- ADD TO EXPONENT
ADN	CAL	0
	TAD	.AA
	DAC	.AA
	GLK
	TAD	.AAG
	TAD	M1
	DAC	.AAG
	JMP*	ADN
/
	/.SET-DOUBLE PREC SETUP
.SET	CAL	0
	DAC*	.SET
	ISZ	.SET
	JMP*	.SET
/
	/.FRE-.FDB ARG TO HAC
	/.CG-SIGN CONTROL
.FRE	CAL	0
	DZM	.AAG	/0 TO EX GUARD
	DZM	NORS
	LAC	.SET
	DZM	.SET
	SZA
	JMP	.FDB
	LAC*	CE14	/SINGLE PREC
	AND	REAL04	/EXTRACT LO
	DAC	CE03
	LAC*	CE14
	AND	REAL03	/EXTRACT EX
	XOR	REAL02	/CHANGE SIGN
	TAD	REAL05	/BIAS EX
	DAC	CE01
	ISZ	CE14
	LAC*	CE14
.CG	SAD	CE03	/FRAC = ?
	SZA!CLL		/YES, =0?
	SKP!CLL
	DZM	CE01
	TAD	CN01	/SIGN TO L
	AND	CN02	/ABS VALUE
	DAC	CE02	/OF FRAC
	GLK
	DAC	CEHS	/SAVE SIGN
	XOR	CE05
	DAC	.CE	/JOINT SIGN
	LAC	.AB	/ABS VALUE
	AND	CN02	/OF FAC
	DAC	.AB
	JMP*	.FRE
.FDB	LAC*	CE14	/DOUBLE PREC
	XOR	CN01	/ADD BIAS
	DAC	CE01
	ISZ	CE14
	LAC*	CE14
	DAC	CE02
	ISZ	CE14
	LAC*	CE14
	DAC	CE03
	LAC	CE02
	JMP	.CG
/
	/.BA-NEGATE FAC
.BA	CAL	0
	ISZ	CE05
	JMS	.ZRSN
	ISZ	CEHS	/- RESIDUE
	JMP*	.BA
T2=.BA
/
	/.AW-INTEGER T0 FLOAT
	/INTEGER IN A
.AW	CAL	0
	DZM	CE05	/SET SIGN +
	DZM	.AC	/0 TO LOW
	DZM	.A4	/FRACS
	SMA
	JMP	AW01
	CMA		/2'S COMPL
	TAD	CN03
	ISZ	CE05	/SET SIGN -
AW01	DAC	.AB
	LAC	AW02	/FORM EXP
	DAC	.AA
	JMS	.CD	/NORM
	JMS	.ZRSN	/PACK SIGN
	JMS	RS0	/0 TO HAC
	JMP*	.AW
AW02	400021
/
	/.AX-FLOAT TO INTEGER
/IF I>18 BITS,RIGHTMOST 18 BITS GIVEN &
/OTS 0.  -2**17 IS CONVERTED
.AX	CAL	0
	JMS	.AP	/SAVE FAC
		TP1
	LAC	TP1	/UNBIAS EXP
	TAD	M22	/FORM EXDEL
	LRSS		/SIGN TO L
	SNA!CLC		/EXDEL=0 ?
	LAC	.AC	/YES
	SMA!CLA		/.AC + ?
	LAC	.AB	/YES
	SAD	(600000
	JMP	AX02	/= -2**17
AX01	SNL		/EXDEL - ?
	JMS*	.ER	/INTEGER OV
	NOP		/OTS 0 OR
			/NULL COMM.
AX02	JMS	.AG	/LD 2**35
		TWO35	/ARG TO HAC
	LAC	TP1+1	/SIGN OF ARG
	SPA
	ISZ	.AA	/2**36 IF -
	JMS	.CC	/ADD HAC
	JMS	.CD	/NORMALIZE
	JMS	.AO	/RESTORE FAC
		TP1	/.AC TO CE03
			/.AB IN A
	SPA!CLA		/ARG - ?
	LAC	.A4	/YES
	SZA!CLA		/RESIDUE 0 ?
	ISZ	CE03	/NO,RD UP
	LAC	CE03	/= INTEGER
	JMP*	.AX
TWO35	43
	200000
/
/ROUTINES USED IN MULTI-PREC. PACKAGE
/
.XCH	XX	/EXCHANGE HAC&FAC
	JMS	.XFR
	JMS	.XSE
	JMP*	.XCH
/
RS0	XX		/0 TO HAC
	DZM	CE01
	DZM	CE02
	DZM	CE03
	JMP*	RS0
/
/
.APH	XX	/STORE HAC
	LAC*	.-1
	DAC	.+3
	JMS	.XCH	/SWITCH FAC&HAC
	JMS	.AP	/STORE HAC
	0
	JMS	.XCH
	ISZ	.APH
	JMP*	.APH
/
	.END
