Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50161/mexp.mp
There are no other files named mexp.mp in the archive.
TITLE MEXP
DEFINE DCONST(DX,Y)
< MOVM AC1,DX
MOVEI AC0,0
LSHC AC0,11
SUBI AC0,200
ADD AC0,[200000000000]
SKIPGE DX
MOVNM AC0,AC0
MOVEM AC0,Y
MOVE AC0,DX
MOVE AC1,DX+1
SKIPGE AC0
DFN AC0,AC1
LSH AC1,11
LSHC AC0,10
TLZ AC0,400000
LSH AC1,-1
MOVEM AC0,Y+1
MOVEM AC1,Y+2
ZAP (Y,3) >
DEFINE ZAP(A,B)
< MOVE AC2,PREC
MOVEI AC1,B
AOS AC2
CAIG AC2,B
JRST .+4
SOS AC2
SETZM A(AC2)
JRST .-4 >
DEFINE DPVAL(X,DY,%ODDERR,%ASS)
< MOVM AC0,X
SUB AC0,[200000000000]
ADDI AC0,200
MOVEM AC0,EXP#
TDZE AC0,[777777777400]
JRST ERROR#
MOVE AC1,X+1
MOVE AC2,X+2
TRNE AC2,1 00000
AOS AC2
JUMPL AC2,%ODDERR
%ASS: LSH AC2,1
LSHC AC1,1
LSHC AC0,33
LSH AC1,-33
LSHC AC1,^D18
MOVE AC2,EXP
SUBI AC2,33
LSH AC2,^D27
IOR AC1,AC2
SKIPGE X
DFN AC0,AC1
MOVEM AC0,DY
MOVEM AC1,DY+1
JRST .+7
%ODDERR: AOS AC1
TLZN AC2,400000
JRST %ASS
LSHC AC1,-1
JRST %ASS >
DEFINE SETPREC (N)
< MOVEI AC0,N
MOVEM AC0,PREC#>
DEFINE COPY(X,Y)
< IRP Y<
HRLI AC2,X
HRRI AC2,Y
MOVE AC1,PREC
ADDI AC1,Y
HRRM AC1,.+1
BLT AC2,.>>
DEFINE MADD(X,Y,Z)
< JSA 16,MADD
EXP X,Y,PREC,Z
JRST OUTNOW>
DEFINE MMUL(X,Y,Z)
< JSA 16,MMULT
EXP X,Y,PREC,Z
JRST 2 >
DEFINE M DIV(X,Y,Z)
< JSA 16,MDIV
EXP X,Y,PREC,Z
JRST 3 >
EXTERN MADD,MMULT,MDIV
ENTRY MEXP
MEXP: 0
MOVM 0,@0(16)
HRRI AC1,@0(16)
AOS AC1
HRRM AC1,.+1
MOVM AC1,.
MOVEM AC0,DX
MOVEM AC1,DX+1
S0: SETPREC(2)
DCONST (DX,X)
COPY (ONES,<TERM,SUM,N>)
AGGY: MMUL (TERM,X,TERM)
MDIV (TERM,N,TERM)
MADD (SUM,TERM,SUM)
MADD (N,ONES,N)
MOVM AC4,SUM
MOVM AC5,TERM
SUB AC4,AC5
CAIGE AC4,^D70
JRST AGGY
OUTNOW: SKIPL @(16)
JRST AGNES
MDIV (ONES,SUM,SUM)
AGNES: DPVAL(SUM,DANS)
MOVE AC0,DANS
MOVE AC1,DANS+1
JRA 16,1(16)
DANS: BLOCK 2
DX: BLOCK 2
ONES: OCT 200000000001,200000000000,0,0
TERM: BLOCK 4
N: BLOCK 4
SUM: BLOCK 4
X: OCT 200000000001,200000000000,0,0
AC5=5
AC4=4
AC0=0
AC1=1
AC2=2
END