Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
X86 assembly language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Floating-point instructions=== x86 assembly language includes instructions for a stack-based floating-point unit (FPU). The FPU was an optional separate coprocessor for the 8086 through the 80386, it was an on-chip option for the 80486 series, and it is a standard feature in every Intel x86 CPU since the 80486, starting with the Pentium. The FPU instructions include addition, subtraction, negation, multiplication, division, remainder, square roots, integer truncation, fraction truncation, and scale by power of two. The operations also include conversion instructions, which can load or store a value from memory in any of the following formats: binary-coded decimal, 32-bit integer, 64-bit integer, 32-bit floating-point, 64-bit floating-point or 80-bit floating-point (upon loading, the value is converted to the currently used floating-point mode). x86 also includes a number of [[transcendental function]]s, including sine, cosine, tangent, arctangent, exponentiation with the base 2 and logarithms to bases 2, 10, or [[E (mathematical constant)|''e'']]. The stack register to stack register format of the instructions is usually <code>f''op'' st, st(''n'')</code> or <code>f''op'' st(''n''), st</code>, where <code>st</code> is equivalent to <code>st(0)</code>, and <code>st(''n'')</code> is one of the 8 stack registers (<code>st(0)</code>, <code>st(1)</code>, ..., <code>st(7)</code>). Like the integers, the first operand is both the first source operand and the destination operand. <code>fsubr</code> and <code>fdivr</code> should be singled out as first swapping the source operands before performing the subtraction or division. The addition, subtraction, multiplication, division, store and comparison instructions include instruction modes that pop the top of the stack after their operation is complete. So, for example, <code>faddp st(1), st</code> performs the calculation <code>st(1) = st(1) + st(0)</code>, then removes <code>st(0)</code> from the top of stack, thus making what was the result in <code>st(1)</code> the top of the stack in <code>st(0)</code>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)