User Tools

Site Tools


fscale

This is an old revision of the document!


    rem Expo .... Rev 2.0
    rem A J Tooth // October 2015
  • FLOAT64

mode 14 : off : colour 132,50,0,0 : colour 132 : cls

    input tab(5,5);"Enter a value; ";X
    ResB = exp(X)
    print tab(5,5);"BBC version of EXP(";X;")=";ResB
    Res = fn_EXP(1.0*X)
    print tab(5,10);"ASM version of EXP(";X;")= ";Res
    a$=get$
    quit
    rem End of Program ===============================================
    rem ==============================================================
    rem Exponential routine
    def fn_EXP(X#)
    local Res#
    private xpo%,P%,opt&
    if xpo% = 0 then

      dim xpo% 100

      for opt& = 0 to 2 step 2
  
        P% = xpo%
  
        [opt opt&
  
        finit
        mov esi,[ebp+2]
        fld qword [esi]
  
        fldl2e
        fmulp st1,st0
        fld st0
        frndint
        fsub st1,st0
        fxch st1
        f2xm1
        fld1
        faddp st1,st0
        fscale
  
        mov esi,[ebp+7]
        fstp qword [esi]
  
        ret
        ]
      next opt&
    endif
    call xpo%, X#, Res#
    = Res#
    rem ====================================================================
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
fscale.1522506045.txt.gz · Last modified: 2018/03/31 14:20 by 127.0.0.1