fb:porticula NoPaste
Eulersche Zahl und EXP(x) in ASM
Uploader: | Volta |
Datum/Zeit: | 13.01.2008 00:02:55 |
Const e_con As Double = 2.718281828459045
Function asm_exp (x As Double) As Double
Asm
fld qword ptr [x]
fldl2e
fmulp st(1), st(0)
fld st(0)
frndint
fxch
fsub st(0), st(1)
f2xm1
fld1
faddp st(1), st(0)
fscale
fstp qword Ptr [Function]
fstp st(0)
End Asm
End Function
Function e As Double
Asm
fld1
fldl2e
fsub st(0), st(1)
f2xm1
fadd st(0), st(1)
fscale
fstp qword Ptr [Function]
fstp st(0)
End Asm
End Function
Screen 18,32
Dim As Double x=2.2, n
? Exp(x)
? asm_exp(x)
? asm_exp(1)
? e
? e_con
Sleep