1 2#include <asm.inc> 3 4PUBLIC _exp 5 6/* FUNCTIONS ***************************************************************/ 7.code 8 9_exp: 10 push ebp 11 mov ebp, esp 12 13 fld qword ptr [ebp + 8] 14 fxam 15 fstsw ax 16 fwait 17 sahf 18 jnp .not_inf 19 jnc .not_inf 20 test ah, 2 21 jz .done 22 fstp st 23 fldz 24 jmp .done 25.not_inf: 26 fldl2e 27 fmul st, st(1) 28 fst st(1) 29 frndint 30 fxch st(1) 31 fsub st, st(1) 32 f2xm1 33 fld1 34 faddp st(1), st 35 fscale 36 fstp st(1) 37.done: 38 pop ebp 39 ret 40 41END 42