UMBC CMSC 313 -- Floating-Point Instructions Previous | Next


Floating-Point Instructions

Form of Floating-Point Instructions

All floating point operations, and only floating point operations, start with an initial f.
  foperation    zero or more operands
For BCD and integer operands, there is a second letter:
  fboperation operand     ;BCD operand
  fioperation operand     ;Integer operand
All other second letters are for floating point arguments.

If the last letter is a 'p', the FPU stack is popped on completion of the operation.

  foperationp    zero or more operands

X87 FPU Instructions

Data Transer

FLD Load floating-point value
FST Store floating-point value
FSTP Store floating-point value and pop
FILD Load integer
FIST Store integer
FISTP Store integer and pop
FBLD Load BCD
FBSTP Store BCD and pop
FXCH Exchange registers
FCMOVE Floating-point conditional move if equal
FCMOVNE Floating-point conditional move if not equal
FCMOVB Floating-point conditional move if below
FCMOVBE Floating-point conditional move if below and equal
FCMOVNB Floating-point conditional move if not below
FCMOVNBE Floating-point conditional move if not below or equal
FCMOVU Floating-point conditional move if unordered
FCMOVNU Floating-point conditional move if not unordered

Basic Arithmetic

FADD Add floating-point
FADDP Add floating-point and pop
FIADD Add integer
FSUB Subtract floating-point
FSUBP Subtract floating-point and pop
FISUB Subtract integer
FSUBR Subtract floating-point reverse
FSUBRP Subtract floating-point reverse and pop
FISUBR Subtract integer reverse
FMUL Multiply floating-point
FMULP Multiply floating-point and pop
FIMUL Multiply integer
FDIV Divide floating-point
FDIVP Divide floating-point and pop
FIDIV Divide integer
FDIVR Divide floating-point reverse
FDIVRP Divide floating-point reverse and pop
FIDIVR Divide integer reverse
FPREM Partial remainder
FPREM1 IEEE Partial remainder
FABS Absolute value
FCHS Change sign
FRNDINT Round to integer
FSCALE Scale by power of two
FSQRT Square root
FXTRACT Extract exponent and significand

Comparison

FCOM Compare floating-point
FCOMP Compare floating-point and pop
FCOMPP Compare floating-point and pop
FUCOM Unordered compare floating-point
FUCOMP Unordered compare floating-point and pop
FICOMPP Unordered compare floating-point and pop twice
FICOM Compare integer
FICOMP Compare integer and pop
FCOMI Compare floating-point and set EFLAGS
FUCOMI Unordered compare floating-point and set EFLAGS
FCOMIP Compare floating-point, set EFLAGS and pop
FUCOMIP Unordered compare floating-point, set EFLAGS and pop
FTST Test floating-point (compare with 0.0)
FXAM Exam floating-point

Transcendental

FSIN Sine
FCOS Cosine
FSINCOS Sine and cosine
FPTAN Partial tangent
FPATAN Partial arctangent
F2XM1 2x - 1
FYL2X y*log2x
FYL2XP1 y*log2(x+1)

Load Constants

FLD1 Load +1.0
FLDZ Load +0.0
FLDPI Load (the value of pi)
FLDL2E Load log2e
FLDLN2 Load loge2
FLDL2T Load log2>10
FLDLG2 Load log102

x87 FPU Control

FINCSTP Increment FPU register stack pointer
FDECSTP Decrement FPU register stack pointer
FFREE Free floating-point register
FINIT Initialize FPU after checking error conditions
FNINIT Initialize FPU without checking error conditions
FCLEX Clear floating-point without exception flags after checking for error conditions
FNCLEX Clear floating-point without exception flags without checking for error conditions
FSTCW Store FPU control word after checking error conditions
FNSTCW Store FPU control word without checking error conditions
FLDCW Load FPU contgrol word
FSTENV Store FPU environment after checking error conditions
FNSTENV Store FPU environment without checking error conditions
FLDENV Load FU environment
FSAVE Save FPU state after checking error conditions
FNSAVE Save FPU state without checking error conditions
FRSTOR Restore FPU state
FSTSW Store FPU status word after checking error conditions
FNSTSW Store FPU status word withou checking error conditions
WAIT/FWAIT Wait for FPU
FNOP FPU no operation


Previous | Next

©2004, Gary L. Burt