[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
x86ASMFAQ_FPU
What is the FPU?
FPU stands for Floating Point Unit and is also referred to as the 8087. The floating point unit handles numbers with fractional parts, e.g. 4.52347. It also allows you to do transcendental and trigonometric functions such as cosine. The FPU is different from the general purpose integer registers in that the FPU is arranged as a stack. Most FPU operations operate on the top of the stack.
How do I do <insert transcendental function>?
An example of a question that would fall here is, "How do I calculate the natural logarithm?" The FPU provides only certain transcendental functions, nevertheless it has the ability to quickly and easily calculate every common transcendental function. How? Simple algebra. An example: To calculate the natural logarithm of x, you use the fyl2x (which is mnemonic for y*log2(x)) and you simply have y, st(1), be 1/log2(e) (a constant). This uses the change of base formula, logA(x)=logB(x)/logB(A). The Art of Assembly has a good listing of how to calculate all the common transcendentals, so check it out.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
x86ASMFAQ_FPU
What is the FPU?
FPU stands for Floating Point Unit and is also referred to as the 8087. The floating point unit handles numbers with fractional parts, e.g. 4.52347. It also allows you to do transcendental and trigonometric functions such as cosine. The FPU is different from the general purpose integer registers in that the FPU is arranged as a stack. Most FPU operations operate on the top of the stack.
How do I do <insert transcendental function>?
An example of a question that would fall here is, "How do I calculate the natural logarithm?" The FPU provides only certain transcendental functions, nevertheless it has the ability to quickly and easily calculate every common transcendental function. How? Simple algebra. An example: To calculate the natural logarithm of x, you use the fyl2x (which is mnemonic for y*log2(x)) and you simply have y, st(1), be 1/log2(e) (a constant). This uses the change of base formula, logA(x)=logB(x)/logB(A). The Art of Assembly has a good listing of how to calculate all the common transcendentals, so check it out.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
