Google
 

Trailing-Edge - PDP-10 Archives - AP-D480B-SB_1978 - fkidar.unv
There are no other files named fkidar.unv in the archive.
x
(4	@P Ih #x)

ENTRY $DAM.A
	SIXBIT /$8DAM.A/
DAM.A:	$X$FLADD A
	DMOVE$xM A,(M)		;SAVE I%N MEMORY
	POPJ P,

 hIh Bx!

ENTRY CDDM.A
	SIXBIT /C8DDM.A/
DDM.A:	CXPUSHJ P,DFD.A##
	DMOVEM A,(M)		D;STORE IN MEMORY
	POPJ P,
I "X

ENTRY "xDFA.A
	SIXBIT /#DFA.A/
DFA.A:	#8$FLADD A
	POPJ P,

I  AX

ENTRY AxDFD.A
	SIXBIT /BDFD.A/
DFD.A:	B8$FLDIV(A)
	POPJ P,
I` DXq
;	DOUBLEDx PRECISION FLOAT EFUNCTION "DFLOAT"E8
	ENTRY	DFL.A		EX;ENTRY POINT TO DExFL.A
	SIXBIT	/DFFL.A/
DFL.A:
F8IFE CPU-KA10,<
	FXHLRE	A+1,A		;COFxPY HI PART OF INTGEGER
	HLL	A,A+G81		;FILL UPPER PAGXRT OF A WITH SIGGxN
	FSC	A,233		;HFLOAT LOW HALF OFH8 INTEGER
	SKIPGEHX	A		;FOR NEGATIVHxE NUMBERS
	AOJE	IA+1,DFL.XT	;CHANI8GE HIGH ORDER FROIXM 1 TO 2 COMP
	FIxSC	A+1,255		;FLOJAT THE HIGH PART
	FADL	A,A+1		;JXDOUBLE PRECISION JxRESULT
>
IFE CPKU-KI10,<
	MOVEI	K8A+1,0		;CLEAR LOKXW ORDER WORD
	ASKxHC	A,-8		;MAKE RLOOM FOR EXPONENT L8IN HI WORD
	TLC	LXA,243000	;SET EXLxP TO 27+8 DECIMALM
	DFAD	A,[EXP 0M8,0]	;NORMALIZE
>MX
DFL.XT:	POPJ	P,Mx		;RETURN A=THE NDOUBLE PRECISION RESULT
Ih 581

ENTRY 5XDFM.A
	SIXBIT /5xDFM.A/
DFM.A:	6$FLMUL A
	POPJ P,
I %X=

ENTRY %xDFS.A
	SIXBIT /&DFS.A/
DFS.A:	&8KADFN A,A+1		;N&XEGATE AC
	PUSHJ &xP,DFA.A##	;DOUBL'E PRECISION ADD
'8	KADFN A,A+1		;'XNEGATE AC AGAIN
	POPJ P,
TY%STI6h 6X?

ENTRY 6xDMM.A
	SIXBIT /7DMM.A/
DMM.A:	78$FLMUL A
	DMOVE7XM A,(M)		;PUT AN7xSWER IN MEMORY
	POPJ P,
INh (S

ENTRY (8DSM.A
	SIXBIT /(XDSM.A/
DSM.A:	(xKADFN A,A+1	;NE)GATE AC
	PUSHJ P)8,DFA.A##	;ADD
	)XKADFN A,A+1		;N)xEGATE AC AGAIN
	*DMOVEM A,(M)		;S*8TORE IN MEMORY
	POPJ P,
*D S0 NX=
;	DOUBLENx PRECISION FIX FUONCTION "IDINT"
	O8ENTRY	IDF.A
	SIOXXBIT	/IDF.A/
IDOxF.A:
IFIDN	<A>P,<14>,<S.==T3>	;DP8EFINE A SCRATCH RPXEG
IFDIF	<A>,<1Px4>,<S.==L>
	PUSHQ	P,S.		;SAVE THE Q8SCRATCH REG
	HLRQXE	S.,A		;GET THEQx EXPONENT
	ASH	SR.,-9		;RIGHT 8 BIR8TS
	JUMPGE	A,IDRXF.XT	;JUMP IF POSRx.
	DFN	A,A+1		S;NEGATE
	TRC	S.,S8-1		;COMPLEMENT TSXHE EXPONENT
IDF.SxXT:	TLZ	A,777000T	;CLEAR THE EXPONT8ENT
IFE CPU-KA10TX,<
	LSH	A+1,8		Tx;WIPE OUT THE LOWU ORDER EXPONENT
U8>
	ASHC	A,-201-UX^D26(S.)	;CHANGE UxFRACTION TO INTEGVER
	SKIPGE	S.		;V8SKIP IF POS.
	MOVXVNS	A		;NEGATE
Vx	POP	P,S.		;RESTOWRE THE SCRATCH REW8G
	POPJ	P,		;RETWXURN A=FIXED NUMBER
Z@ b@ g:8 X!
;	DOUBLEX8 PRECISION SINGLEXX FUNCTION
	ENTRYXx	SNG.A
	SIXBIT	Y/SNG.A/
SNG.A:Y8
IFE CPU-KA10,<
	FADR	A,A+1		;YxADD IN LOW ORDER ZAND ROUND.
>
IFZ8E CPU-KI10,<
	JUZXMPL	A,SNG3		;NEGZxATIVE ARGUMENT?
[	TLNE	A+1,(1B1)	[8;POSITIVE. ROUND [XREQUIRED?
	TRON	[xA,1		;YES, TRY T\O ROUND BY SETTIN\8G LSB
	JRST	SNG2\X		;WE WON, FINISH\xED
	MOVE	A+1,A]		;COPY HIGH PART]8 OF ARG
	AND	A,]X[777000,,1]	;MAKE]x UNNORMALIZED LSB^, SAME EXPONENT
^8	FADR	A,A+1		;R^XOUND & RENORMALIZ^xE
	GOODBY

;HE_RE IF ARG IS NEGA_8TIVE
SNG3:	DMOVN_X	A,A		;MAKE POS_xITIVE
	TLNE	A+1`,(1B1)	;NEED ROUN`8DING?
	TRON	A,1`X		;YES, TRY TO DO`x IT BY SETTING LSaB
	JRST	SNG4		;Da8ONE
	MOVN	A+1,aXA		;MAKE RE-NEGATaxED COPY OF HIGH PbART
	ORCA	A,[77b87,,-1]	;GET UNNORbXM NEG LSB WITH SAbxME EXPONENT
	FADcR	A,A+1		;ROUNDc8 & NORMALIZE
	GOcXODBY

SNG4:	MOVcxN	A,A		;RE-NEGAdTE
>
SNG2:	GOODBY			;EXIT
	d x
	PUSH P,A+2		;SAVE 3RD A8C
	PUSH P,(M)		;XGET HIGH PART OF xMEM ARG AWAY FROM A+2
	PUSH P,1(8M)		;GET LOW ARG XAWAY FROM A,A+1x OR A+2
	UFA A+1,(P)		;ADD LOW 8ORDER PARTS
	FADXL A,-1(P)		;ADD xHIGH ORDER PARTS
	JOV b			;IF OV8ER/UNDERFLOW, FIXX AND EXIT
	UFA xA+1,A+2		;ADD LO W PART TO SUM OF  8LOWER PARTS
	FAD XL A,A+2		;ADD H xIGH PART OF SUM T!O LOW PART
b:	S!8UB P,[2,,2]		;GET!X MEMORY ARG OFF S!xTACK
	POP P,A+2"		;RESTORE A+2
	dJ; 88	
	PUSH P,8XA+2		;GET A+2 O8xUT OF WAY
	PUSH 9P,(M)		;GET HIGH 98PART OF MEM ARG O9XN PDL
	PUSH P,1(9xM)		;DITTO FOR LO:W
	FDVL A,(M)		:8;GET QUOTIENT AND:X REMAINDER
	JOV :xb		;XFER FOR UND;ER/OVERFLOW(NOT Q;8UITE RIGHT FOR OV;XERFLOW)
	MOVN A;x+2,A		;NEGATE HI<GH ORDER DIVIDEND<8
	FMPR A+2,(P)	<X	;MUL THE LOW ORD<xER ANSWER
	JFCL =(2)		;IN CASE OF =8UNDERFLOW, UN-NOR=XMALIZE
	UFA A+1=x,A+2		;ADD LOW P>ROD. TO -DIVIDEND>8
	FDVR A+2,-1(P>X)		;DIV THE LOW B>xITS BY DIVISOR
	?JFCL			;IN CASE O?8F UNDERFLOW
	FAD?XL A,A+2		;ADD F?xINAL RESULT INTO @A,A+1
b:	SUB @8P,[2,,2]		;REMOVE@X MEMORY ARG FROM @xSTACK
	POP P,A+A2		;RESTORE A+2
	e]6 *x'
	PUSH P,+A+2		;SAVE A+2
	PUSH P,(M)		;GE+XT HIGH PART OF ME+xM ARG OUT OF WAY ,OF A+2
	PUSH P,,81(M)		;DITTO FOT ,XLOW PART
	MOVEM ,xA,A+2		;COPY HI-GH PART OF AC ARG-8
	FMPR A+2,(P)	-X	;FORM 1 CROSS PR-xODUCT
	JFCL (2)	.	;IN CASE OF UNDE.8RFLOW, UN-NORMALI.XZE
	FMPR A+1,-1.x(P)		;FORM OTHER /CROSS PRODUCT
	J/8FCL (2)		;IN CASE/X OF UNDERFLOW, UN/x-NORMALIZE
	UFA 0A+1,A+2		;ADD C08ROSS PRODUCTS
	J0XFCL			;OVERFLOW O0xNLY IF NEXT INSTR1UCTION ALSO
	FMP18L A,-1(P)		;FORM1X PRODUCT OF HIGH 1xORDER PARTS
	JOV2 b			;FIX AND XF28ER IN CASE OF OVE2XR/UNDERFLOW
	UFA2x A+1,A+2		;ADD 3XROSS PRODUCT SUM38 INTO LOW WORD
	3XFADL A,A+2		;AD3xD HIGH AND LOW WO4RDS
b:	SUB P,[248,,2]		;GET MEMORY4X ARG OFF STACK
	4xPOP P,A+2		;RESTORE A+2
S@P >}{woP