📄 exp.s
字号:
/ / .data/ .asciz "@(#)exp.s 1.1 92/07/30 SMI"/ .even/ .text// Copyright (c) 1987 by Sun Microsystems, Inc. .data .align 4inf: .long 0x7f800000 .text .globl expexp: pushl %ebp movl %esp,%ebp fldl 8(%ebp) / push arg fxam fnstsw %ax / store status in %ax movw %ax,%cx andw $0x4500,%cx cmpw $0x0100,%cx jne xnotnan fld %st(0) / x , x faddp %st,%st(1) / x leave retxnotnan: andw $0x4700,%ax cmpw $0x0700,%ax jne xnotninf fstp %st(0) / stack empty fldz / 0 leave retxnotninf: cmpw $0x0500,%ax jne xnotspecial leave / x = +inf retxnotspecial: fldl2e / push log2(e) fmulp %st,%st(1) / z = arg*log2(e) fld %st(0) / duplicate stack top frndint / [z],z fxch / z,[z] fucom fnstsw %ax sahf je L1 fsub %st(1),%st / z-[z],[z] f2xm1 / 2**(z-[z])-1, [z] fld1 / 1,2**(z-[z])-1, [z] faddp %st,%st(1) / 2**(z-[z]),[z] jmp mergeL1: fstp %st(0) fld1merge: fscale fstp %st(1) fstpl -8(%esp) / round to double fldl -8(%esp) / exp(x) rounded to double fxam / determine class of exp(x) fnstsw %ax / store status in ax andw $0x4500,%ax cmpw $0x0500,%ax jne notoverflow fstp %st(0) / stack empty pushl $6 jmp errornotoverflow: cmpw $0x4000,%ax jne notunderflow fstp %st(0) / stack empty pushl $7 jmp errornotunderflow: leave reterror: pushl 12(%ebp) / high x pushl 8(%ebp) / low x pushl 12(%ebp) / high x pushl 8(%ebp) / low x call SVID_libm_err addl $20,%esp leave ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -