mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-08-21 21:29:08 +00:00
Consistent API names for SANE
This commit is contained in:
parent
00cf842afb
commit
b6d7986249
@ -130,17 +130,17 @@ end
|
|||||||
// SANE PLASMA interface
|
// SANE PLASMA interface
|
||||||
//
|
//
|
||||||
struc t_sane
|
struc t_sane
|
||||||
word fpInit
|
word initFP
|
||||||
word fpHalt
|
word haltFP
|
||||||
word fpOp0
|
word op0FP
|
||||||
word fpOp1
|
word op1FP
|
||||||
word fpOp2
|
word op2FP
|
||||||
word fpOp3
|
word op3FP
|
||||||
word elOp1
|
word op1ELEM
|
||||||
word elOp2
|
word op2ELEM
|
||||||
word elOp3
|
word op3ELEM
|
||||||
word zpSave
|
word saveZP
|
||||||
word zpRestore
|
word restoreZP
|
||||||
end
|
end
|
||||||
word sane
|
word sane
|
||||||
end
|
end
|
||||||
|
@ -124,8 +124,8 @@ export def str2ext(str, ext)
|
|||||||
decrec.sig = 1
|
decrec.sig = 1
|
||||||
decrec.sig.1 = '0'
|
decrec.sig.1 = '0'
|
||||||
fin
|
fin
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFEXT|FOD2B, ext, @decrec))
|
return sane:restoreZP(sane:op2FP(FFEXT|FOD2B, ext, @decrec))
|
||||||
end
|
end
|
||||||
//
|
//
|
||||||
// Convert extended FP to string using , return string
|
// Convert extended FP to string using , return string
|
||||||
@ -139,8 +139,8 @@ export def ext2str(ext, str, intdigits, fracdigits, format)
|
|||||||
numdigits = intdigits + fracdigits
|
numdigits = intdigits + fracdigits
|
||||||
decform:style = format & $01
|
decform:style = format & $01
|
||||||
decform:digits = decform:style ?? fracdigits :: numdigits
|
decform:digits = decform:style ?? fracdigits :: numdigits
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
sane:zpRestore(sane:fpOp3(FFEXT|FOB2D, @decrec, ext, @decform))
|
sane:restoreZP(sane:op3FP(FFEXT|FOB2D, @decrec, ext, @decform))
|
||||||
^(str+1) = decrec.sgn ?? '-' :: ' '
|
^(str+1) = decrec.sgn ?? '-' :: ' '
|
||||||
if decrec.sig.1 == 'I'
|
if decrec.sig.1 == 'I'
|
||||||
^(str+2) = 'I'
|
^(str+2) = 'I'
|
||||||
|
@ -53,28 +53,28 @@ word stackRegs[4]
|
|||||||
// Environment access
|
// Environment access
|
||||||
//
|
//
|
||||||
def setEnv(env)
|
def setEnv(env)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FOSETENV, env))
|
return sane:restoreZP(sane:op1FP(FOSETENV, env))
|
||||||
end
|
end
|
||||||
def getEnv
|
def getEnv
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp0(FOGETENV))
|
return sane:restoreZP(sane:op0FP(FOGETENV))
|
||||||
end
|
end
|
||||||
def testExcept(except)
|
def testExcept(except)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FOTESTXCP, except))
|
return sane:restoreZP(sane:op1FP(FOTESTXCP, except))
|
||||||
end
|
end
|
||||||
def setExcept(except)
|
def setExcept(except)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FOSETXCP, except))
|
return sane:restoreZP(sane:op1FP(FOSETXCP, except))
|
||||||
end
|
end
|
||||||
def enterProc(pEnv)
|
def enterProc(pEnv)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FOPROCENTRY, pEnv))
|
return sane:restoreZP(sane:op1FP(FOPROCENTRY, pEnv))
|
||||||
end
|
end
|
||||||
def exitProc(env)
|
def exitProc(env)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FOPROCEXIT, env))
|
return sane:restoreZP(sane:op1FP(FOPROCEXIT, env))
|
||||||
end
|
end
|
||||||
//
|
//
|
||||||
// Stack manipulation routines
|
// Stack manipulation routines
|
||||||
@ -118,79 +118,79 @@ end
|
|||||||
def clear
|
def clear
|
||||||
word zero
|
word zero
|
||||||
zero = 0
|
zero = 0
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFINT|FOZ2X, stackRegs[0], @zero))
|
return sane:restoreZP(sane:op2FP(FFINT|FOZ2X, stackRegs[0], @zero))
|
||||||
end
|
end
|
||||||
//
|
//
|
||||||
// Stack access
|
// Stack access
|
||||||
//
|
//
|
||||||
def pushInt(pInt)
|
def pushInt(pInt)
|
||||||
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFINT|FOZ2X, stackRegs[0], pInt))
|
return sane:restoreZP(sane:op2FP(FFINT|FOZ2X, stackRegs[0], pInt))
|
||||||
end
|
end
|
||||||
def pullInt(pInt)
|
def pullInt(pInt)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFINT|FOX2Z, pInt, stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFINT|FOX2Z, pInt, stackRegs[0])))
|
||||||
end
|
end
|
||||||
def loadInt(pInt, reg)
|
def loadInt(pInt, reg)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFINT|FOZ2X, stackRegs[reg & $03], pInt))
|
return sane:restoreZP(sane:op2FP(FFINT|FOZ2X, stackRegs[reg & $03], pInt))
|
||||||
end
|
end
|
||||||
def storInt(pInt, reg)
|
def storInt(pInt, reg)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFINT|FOX2Z, pInt, stackRegs[reg & $03]))
|
return sane:restoreZP(sane:op2FP(FFINT|FOX2Z, pInt, stackRegs[reg & $03]))
|
||||||
end
|
end
|
||||||
def pushSgl(pSgl)
|
def pushSgl(pSgl)
|
||||||
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFSGL|FOZ2X, stackRegs[0], pSgl))
|
return sane:restoreZP(sane:op2FP(FFSGL|FOZ2X, stackRegs[0], pSgl))
|
||||||
end
|
end
|
||||||
def pullSgl(pSgl)
|
def pullSgl(pSgl)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFSGL|FOX2Z, pSgl, stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFSGL|FOX2Z, pSgl, stackRegs[0])))
|
||||||
end
|
end
|
||||||
def loadSgl(pSgl, reg)
|
def loadSgl(pSgl, reg)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFSGL|FOZ2X, stackRegs[reg & $03], pSgl))
|
return sane:restoreZP(sane:op2FP(FFSGL|FOZ2X, stackRegs[reg & $03], pSgl))
|
||||||
end
|
end
|
||||||
def storSgl(pSgl, reg)
|
def storSgl(pSgl, reg)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFSGL|FOX2Z, pSgl, stackRegs[reg & $03]))
|
return sane:restoreZP(sane:op2FP(FFSGL|FOX2Z, pSgl, stackRegs[reg & $03]))
|
||||||
end
|
end
|
||||||
def pushDbl(pDbl)
|
def pushDbl(pDbl)
|
||||||
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFDBL|FOZ2X, stackRegs[0], pDbl))
|
return sane:restoreZP(sane:op2FP(FFDBL|FOZ2X, stackRegs[0], pDbl))
|
||||||
end
|
end
|
||||||
def pullDbl(pDbl)
|
def pullDbl(pDbl)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFDBL|FOX2Z, pDbl, stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFDBL|FOX2Z, pDbl, stackRegs[0])))
|
||||||
end
|
end
|
||||||
def loadDbl(pDbl, reg)
|
def loadDbl(pDbl, reg)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFDBL|FOZ2X, stackRegs[reg & $03], pDbl))
|
return sane:restoreZP(sane:op2FP(FFDBL|FOZ2X, stackRegs[reg & $03], pDbl))
|
||||||
end
|
end
|
||||||
def storDbl(pDbl, reg)
|
def storDbl(pDbl, reg)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFDBL|FOX2Z, pDbl, stackRegs[reg & $03]))
|
return sane:restoreZP(sane:op2FP(FFDBL|FOX2Z, pDbl, stackRegs[reg & $03]))
|
||||||
end
|
end
|
||||||
def pushExt(pExt)
|
def pushExt(pExt)
|
||||||
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFEXT|FOZ2X, stackRegs[0], pExt))
|
return sane:restoreZP(sane:op2FP(FFEXT|FOZ2X, stackRegs[0], pExt))
|
||||||
end
|
end
|
||||||
def pullExt(pExt)
|
def pullExt(pExt)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFEXT|FOX2Z, pExt, stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFEXT|FOX2Z, pExt, stackRegs[0])))
|
||||||
end
|
end
|
||||||
def loadExt(pExt, reg)
|
def loadExt(pExt, reg)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFEXT|FOZ2X, stackRegs[reg & $03], pExt))
|
return sane:restoreZP(sane:op2FP(FFEXT|FOZ2X, stackRegs[reg & $03], pExt))
|
||||||
end
|
end
|
||||||
def storExt(pExt, reg)
|
def storExt(pExt, reg)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFEXT|FOX2Z, pExt, stackRegs[reg & $03]))
|
return sane:restoreZP(sane:op2FP(FFEXT|FOX2Z, pExt, stackRegs[reg & $03]))
|
||||||
end
|
end
|
||||||
def pushStr(pStr)
|
def pushStr(pStr)
|
||||||
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
stackRegs[0], stackRegs[1], stackRegs[2], stackRegs[3] = stackRegs[3], stackRegs[0], stackRegs[1], stackRegs[2]
|
||||||
@ -209,139 +209,139 @@ end
|
|||||||
// Basic math operations
|
// Basic math operations
|
||||||
//
|
//
|
||||||
def add
|
def add
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFEXT|FOADD, stackRegs[1], stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFEXT|FOADD, stackRegs[1], stackRegs[0])))
|
||||||
end
|
end
|
||||||
def sub
|
def sub
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFEXT|FOSUB, stackRegs[1], stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFEXT|FOSUB, stackRegs[1], stackRegs[0])))
|
||||||
end
|
end
|
||||||
def mul
|
def mul
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFEXT|FOMUL, stackRegs[1], stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFEXT|FOMUL, stackRegs[1], stackRegs[0])))
|
||||||
end
|
end
|
||||||
def div
|
def div
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFEXT|FODIV, stackRegs[1], stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFEXT|FODIV, stackRegs[1], stackRegs[0])))
|
||||||
end
|
end
|
||||||
def rem
|
def rem
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return _drop(sane:zpRestore(sane:fpOp2(FFEXT|FOREM, stackRegs[1], stackRegs[0])))
|
return _drop(sane:restoreZP(sane:op2FP(FFEXT|FOREM, stackRegs[1], stackRegs[0])))
|
||||||
end
|
end
|
||||||
def neg
|
def neg
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FFEXT|FONEG, stackRegs[0]))
|
return sane:restoreZP(sane:op1FP(FFEXT|FONEG, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def abs
|
def abs
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FFEXT|FOABS, stackRegs[0]))
|
return sane:restoreZP(sane:op1FP(FFEXT|FOABS, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def type
|
def type
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FFEXT|FOCLASS, stackRegs[0]))
|
return sane:restoreZP(sane:op1FP(FFEXT|FOCLASS, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def cmp
|
def cmp
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFEXT|FOCMP, stackRegs[1], stackRegs[0]))
|
return sane:restoreZP(sane:op2FP(FFEXT|FOCMP, stackRegs[1], stackRegs[0]))
|
||||||
end
|
end
|
||||||
def trunc
|
def trunc
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FFEXT|FOTTI, stackRegs[0]))
|
return sane:restoreZP(sane:op1FP(FFEXT|FOTTI, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def round
|
def round
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FFEXT|FORTI, stackRegs[0]))
|
return sane:restoreZP(sane:op1FP(FFEXT|FORTI, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def sqrt
|
def sqrt
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FFEXT|FOSQRT, stackRegs[0]))
|
return sane:restoreZP(sane:op1FP(FFEXT|FOSQRT, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def squared
|
def squared
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFEXT|FOMUL, stackRegs[0], stackRegs[0]))
|
return sane:restoreZP(sane:op2FP(FFEXT|FOMUL, stackRegs[0], stackRegs[0]))
|
||||||
end
|
end
|
||||||
def logb
|
def logb
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp1(FFEXT|FOLOGB, stackRegs[0]))
|
return sane:restoreZP(sane:op1FP(FFEXT|FOLOGB, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def scalb(scale)
|
def scalb(scale)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:fpOp2(FFEXT|FOSCALB, stackRegs[0], scale))
|
return sane:restoreZP(sane:op2FP(FFEXT|FOSCALB, stackRegs[0], scale))
|
||||||
end
|
end
|
||||||
//
|
//
|
||||||
// Elems operations
|
// Elems operations
|
||||||
//
|
//
|
||||||
def cos
|
def cos
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOCOSX, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOCOSX, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def sin
|
def sin
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOSINX, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOSINX, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def tan
|
def tan
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOTANX, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOTANX, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def atan
|
def atan
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOATANX, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOATANX, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def log2X
|
def log2X
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOLOG2X, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOLOG2X, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def log21X
|
def log21X
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOLOG21X, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOLOG21X, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def lnX
|
def lnX
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOLNX, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOLNX, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def ln1X
|
def ln1X
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOLN1X, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOLN1X, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def pow2X
|
def pow2X
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOEXP2X, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOEXP2X, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def pow21X
|
def pow21X
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOEXP21X, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOEXP21X, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def powEX
|
def powEX
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOEXPX, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOEXPX, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def powE1X
|
def powE1X
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOEXP1X, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOEXP1X, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def powE21X
|
def powE21X
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FOEXP21X, stackRegs[0]))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FOEXP21X, stackRegs[0]))
|
||||||
end
|
end
|
||||||
def powXInt(powInt)
|
def powXInt(powInt)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp2(FFEXT|FOXPWRI, stackRegs[0], powInt))
|
return sane:restoreZP(sane:op2ELEM(FFEXT|FOXPWRI, stackRegs[0], powInt))
|
||||||
end
|
end
|
||||||
def powXY
|
def powXY
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(_drop(_swap(sane:elOp2(FFEXT|FOXPWRY, stackRegs[0], stackRegs[1]))))
|
return sane:restoreZP(_drop(_swap(sane:op2ELEM(FFEXT|FOXPWRY, stackRegs[0], stackRegs[1]))))
|
||||||
end
|
end
|
||||||
def compXY
|
def compXY
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(_drop(_swap(sane:elOp2(FFEXT|FOCOMPND, stackRegs[0], stackRegs[1]))))
|
return sane:restoreZP(_drop(_swap(sane:op2ELEM(FFEXT|FOCOMPND, stackRegs[0], stackRegs[1]))))
|
||||||
end
|
end
|
||||||
def annuityXY
|
def annuityXY
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(_drop(_swap(sane:elOp2(FFEXT|FOANNUIT, stackRegs[0], stackRegs[1]))))
|
return sane:restoreZP(_drop(_swap(sane:op2ELEM(FFEXT|FOANNUIT, stackRegs[0], stackRegs[1]))))
|
||||||
end
|
end
|
||||||
def randNum(pSeed)
|
def randNum(pSeed)
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
return sane:zpRestore(sane:elOp1(FFEXT|FORANDX, pSeed))
|
return sane:restoreZP(sane:op1ELEM(FFEXT|FORANDX, pSeed))
|
||||||
end
|
end
|
||||||
//
|
//
|
||||||
// Push useful constants
|
// Push useful constants
|
||||||
@ -360,12 +360,12 @@ def reset
|
|||||||
word zero
|
word zero
|
||||||
|
|
||||||
zero = 0
|
zero = 0
|
||||||
sane:fpInit()
|
sane:initFP()
|
||||||
sane:zpSave()
|
sane:saveZP()
|
||||||
for i = 0 to 3
|
for i = 0 to 3
|
||||||
stackRegs[i] = @stack[i * t_extended]
|
stackRegs[i] = @stack[i * t_extended]
|
||||||
sane:fpOp2(FFINT|FOZ2X, stackRegs[i], @zero)
|
sane:op2FP(FFINT|FOZ2X, stackRegs[i], @zero)
|
||||||
next
|
next
|
||||||
return sane:zpRestore(0)
|
return sane:restoreZP(0)
|
||||||
end
|
end
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user