Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50161/macro.mp
There are no other files named macro.mp in the archive.
SUBTTL MACRO.MP V1 UWO 16-NOV-70 MULTIPLE PRECISION CALLING MACROS
DEFINE CONST(X,Y)
< MOVM AC1,X
MOVEI AC0,0
LSHC AC0,11
SUBI AC0,200
ADD AC0,[200000000000]
LSH AC1,-1
SKIPGE DX
MOVNM AC0,AC0
MOVEM AC0,Y
MOVEM AC1,Y+1
ZAP(Y,2) >
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 .+1 ; NOTE THIS IS AN ERROR AND SHOULD BE FIXED
MOVE AC1,X+1
MOVE AC2,X+2
TRNE AC2,100000
ADDI AC2,200000
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 SPVAL(Y,X,%ODD,%ASS)
< MOVE AC0,Y
SKIPGE AC0
MOVNM AC0,AC0
SUB AC0,[200000000000]
ADDI AC0,200
TDZE AC0,[777777777400]
JRST .+1 ;ERROR,SHOULD NEVER GET HERE,HAHAHAHA
MOVE AC1,Y+1
TRNE AC1,200
AOS AC1
JUMPL AC1,%ODD
LSH AC1,1
%ASS: LSHC AC0,33
SKIPGE AC1
ADDI AC0,1
SKIPGE Y
MOVNM AC0,AC0
MOVEM AC0,X
JRST .+3
AOS AC0
JRST %ASS>
XALL
AC2=2
DEFINE SETPREC (N)
< MOVEI AC0,N
MOVEM AC0,PREC#>
DEFINE CONI(Y,I)
< MOVM AC2,Y
SUB AC2,[200000000000]
JUMPLE AC2,ZERO%
CAILE AC2,^D35
JRST .+1 ; ERROR,FIXUP NEEDED
MOVE AC1,Y+1
MOVEI AC0,0
LSHC AC0,2(AC2)
SKIPGE Y
MOVMM AC0,AC0
MOVEM AC0,I
JRST FINI%
ZERO%: SETZM I
FINI%: >
DEFINE ICON(I,Y)
< MOVM AC1,I
JFFO AC1,.+1
SOS AC2
LSH AC1,0(AC2)
SUBI AC2,^D34
MOVNM AC2,AC2
ADD AC2,[200000000000]
SKIPGE I
MOVNM AC2,AC2
MOVEM AC2,Y
MOVEM AC1,Y+1
ZAP (Y,2) >
DEFINE COPY(X,Y)
< IRP Y<
HRLI AC2,X
HRRI AC2,Y
MOVE AC1,PREC
ADDI AC1,Y
HRRM AC1,.+1
BLT AC2,.>>
DEFINE TEST(X,Y,AC,%AG,%EQUAL,%SIMP,%SMA,%FINI)
< MOVE AC1,X
CAME AC1,Y
JRST %SIMP
MOVE AC0,PREC
MOVEI AC2,1
%AG: MOVE AC1,X(AC2)
CAME AC1,Y(AC2)
JRST %SIMP
SOJE AC0,%SIMP
AOJA AC2,%AG
%EQUAL: MOVEM AC0,AC
JRST %FINI
%SIMP: CAMN AC1,Y(AC2)
JRST %EQUAL
CAMG AC1,Y(AC2)
JRST %SMA
MOVEI AC1,1
MOVEM AC1,AC
JRST %FINI
%SMA: SETOM AC
%FINI: >
DEFINE MADD(X,Y,Z)
< JSA 16,MADD
EXP X,Y,PREC,Z
JRST .+1>
DEFINE MSUB(X,Y,Z)
< JSA 16,MSUB
EXP X,Y,PREC,Z
JRST .+1 ; ERROR,CAVEAT EMPTOR >
DEFINE MMUL(X,Y,Z)
< JSA 16,MMULT
EXP X,Y,PREC,Z
JRST .+1 ; ERROR,OVERFLOW.INTERESTED? FIXIT.
>
DEFINE MDIV(X,Y,Z)
< JSA 16,MDIV
EXP X,Y,PREC,Z
JRST .+1>
SUBTTL USER PROGRAM
EXTERN MADD,MSUB,MMULT,MDIV