Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_1_19910112 - 6-1/language-sources/formsc.unv
There are 3 other files named formsc.unv in the archive. Click here to see a list.
x,5@P GWMYP I]YP I]YP Ii9P M3  YqV
	ENTRY	FZLT.A
	SIXBIT	/FZ0LT.A/
FLT.A:
ZPIFE CPU-KA10,<
	ZpHLRE	A+1,A	;COP[Y THE HI HALT OF [0A TO LOW A+1
	[PHLL	A,A+1	;FILL[p UPPER PART OF A\ WITH THE SIGH
	\0FSC	A,233	;FLOAT\P THE LOW HALT OF \pTHE INTEGER
	SKI]PGE	A	;FOR NEGAT]0IVE NUMBERS
	AOJ]PE	A+1,FLT.XT	;CH]pANGE HIGH PART TO^ 2'S COMPLEMENT
^0	FSC	A+1,255	;FL^POAT THE HIGH PART^p
	FADR	A,A+1	;_COMBINE THE TWO P_0ARTS
>
IFE CPU-_PKI10,<
	FLTR	A,_pA	;USE THE HARDW`ARE
>
FLT.XT:	P`0OPJ	P,	;RETURN A`P=THE FLOATING POINT NUMBER
S@ aV;
	ENTRY	Ia0FX.A
	SIXBIT	/IaPFX.A/
IFX.A:
apIFE CPU-KA10,<
	bMULI	A,400		;SEPb0ERATE THE FRACTIObPN AND EXPONENT
	bpEXCH	A,A+1		;PUcT PARTICAL RESULTc0 IN A
	JUMPGE	cPA+1,IFX.XT	;JUMP cpIF POSITIVE
	TRCd	A+1,-1	;NEGATE d0THE EXPONENT
	MOdPVNS	A		;POSITIVEdp FRACTION
IFX.XTe:	ASH	A,-243(A+e01)	;USE EXPONENT ePAS INDEX
	SKIPGEep	A+1		;SKIP IF PfOSITIVE
	MOVNS	f0A		;NEGATE THE REfPSULT
>
IFE CPU-fpKI10,<
	FIX	A,gA
>
	POPJ	P,		;g0RETRURN A=FIXED NUMBER
S@P >}{woP