Google
 

Trailing-Edge - PDP-10 Archives - BB-D480C-SB_1981 - fordar.unv
There is 1 other file named fordar.unv in the archive. Click here to see a list.
x,5@P I` 
zd9
	XALL

z 
	ENTRY	DFL.A		;
wxENTRY POINT TO DF
wXL.A
	SIXBIT	/DF
{L.A/
DFL.A:	MO
w8VEI	A+1,0		;CLEA
{ R LOW ORDER WORD
{@
	ASHC	A,-8		;MA
{`KE ROOM FOR EXPON
|ENT IN HI WORD
	
| TLC	A,243000	;SE
|@T EXP TO 27+8 DEC
|`IMAL
	DFAD	A,[E
}XP 0,0]	;NORMALIZ
FPE
	POPJ	P,		;RET
FpURN A=THE DOUBLE
G PRECISION RESULT
S0 
GPdq
	XALL

Gp
	ENTRY	IDF.A
	
HSIXBIT	/IDF.A/
H0IDF.A:	PUSH	P,L	
HP	;SAVE THE SCRATC
HpH REG
	HLRE	L,A
I		;GET THE EXPONE
I0NT
	ASH	L,-9		;R
IPIGHT 8 BITS
	JUM
IpPGE	A,IDF.XT	;JU
JMP IF POS.
	DMOV
J0N	A,A		;NEGATE
JP
	TRC	L,-1		;COMP
JpLEMENT THE EXPONE
KNT
IDF.XT:	TLZ	
K0A,777000	;CLEAR T
KPHE EXPONENT
	ASH
KpC	A,-201-^D26(L)
L	;CHANGE FRACTION
L0 TO INTEGER
	TLN
LPE	L,400000	;SKIP 
LpIF POS.
	MOVN	A
M,A		;NEGATE
	PO
M0P	P,L		;RESTORE T
MPHE SCRATCH REG
	
MpPOPJ	P,		;RETURN 
NA=FIXED NUMBER
g:8 
NPeG
	XALL

Np
	ENTRY	SNG.A
	
OSIXBIT	/SNG.A/
O0SNG.A:	JUMPL	A,
OPSNG3		;NEGATIVE A
OpRGUMENT?
	TLNE	
PA+1,(1B1)	;POSITI
P0VE. ROUND REQUIRE
PPD?
	TRON	A,1		;
PpYES, TRY TO ROUND
Q BY SETTING LSB
Q0	  POPJ	P,		;WE W
QPON, FINISHED
	MO
QpVE	A+1,A		;COPY
R HIGH PART OF ARG
R0
	AND	A,[777000
RP,,1]	;MAKE UNNORM
RpALIZED LSB, SAME 
SEXPONENT
	FAD	A
S0,A+1		;ROUND & R
SPENORMALIZE
	POPJ
Sp	P,

;HERE IF A
TRG IS NEGATIVE
S
T0NG3:	DMOVN	A,A	
TP	;MAKE POSITIVE
Tp	TLNE	A+1,(1B1)	
U;NEED ROUNDING?
U0	TRON	A,1		;YES,
UP TRY TO DO IT BY 
UpSETTING LSB
	JRS
VT	SNG4		;DONE
	M
V0OVN	A+1,A		;MAK
VPE RE-NEGATED COPY
Vp OF HIGH PART
	O
WRCA	A,[777,,-1]	
W0;GET UNNORM NEG L
WPSB WITH SAME EXPO
WpNENT
	FADR	A,A
X+1		;ROUND & NORM
X0ALIZE
	POPJ	P,
XP
SNG4:	MOVN	A,
XpA		;RE-NEGATE
	POPJ	P,		;EXIT
>}{woP