[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.

last edited (November 20, 2002) by Darius, Number of views: 1999, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.