2010-11-27 22:12:15 +00:00
|
|
|
|
|
|
|
#include <asm.inc>
|
|
|
|
|
|
|
|
PUBLIC _exp
|
2021-09-13 01:33:14 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
/* FUNCTIONS ***************************************************************/
|
|
|
|
.code
|
|
|
|
|
|
|
|
_exp:
|
|
|
|
push ebp
|
|
|
|
mov ebp, esp
|
|
|
|
|
|
|
|
fld qword ptr [ebp + 8]
|
2015-11-22 01:12:34 +00:00
|
|
|
fxam
|
|
|
|
fstsw ax
|
|
|
|
fwait
|
|
|
|
sahf
|
|
|
|
jnp .not_inf
|
|
|
|
jnc .not_inf
|
|
|
|
test ah, 2
|
|
|
|
jz .done
|
|
|
|
fstp st
|
|
|
|
fldz
|
|
|
|
jmp .done
|
|
|
|
.not_inf:
|
2010-11-27 22:12:15 +00:00
|
|
|
fldl2e
|
|
|
|
fmul st, st(1)
|
|
|
|
fst st(1)
|
|
|
|
frndint
|
|
|
|
fxch st(1)
|
|
|
|
fsub st, st(1)
|
|
|
|
f2xm1
|
|
|
|
fld1
|
|
|
|
faddp st(1), st
|
|
|
|
fscale
|
|
|
|
fstp st(1)
|
2015-11-22 01:12:34 +00:00
|
|
|
.done:
|
2010-11-27 22:12:15 +00:00
|
|
|
pop ebp
|
|
|
|
ret
|
|
|
|
|
|
|
|
END
|