Copyright: Copyright MASM32 2001 All Rights Reserved


 Floating point instructions

Data Transfer

Arithmetic

Trancendental

Control flow

Environment

System

Full Listing


 Full Listing

F2XM1

FABS

FADD

FCHS

FCLEX

FCOM

FSIN

FINCSTP

FDIV

FDIVR

FFREE

FINIT

FLD

FLD1

FLDCW

FSTENV

FMUL

FNOP

FPATAN

FPREM

FRNDINT

FSAVE

FSCALE

FSETPM

FSQRT

FST

FSTSW

FSUB

FSUBR

FTST

FUCOM

FWAIT

FXAM

FXCH

FXTRACT

FYL2X

FYL2XP1


 Data Transfer

Load
FLD	Push real onto stack
FILD	Convert two's complement integer to real and push
FBLD	Convert BCD to real and push to stack
Store
FST	Store floating-point number from stack
FSTP	Convert top of stack to integer
FIST
FISTP	Convert top of stack to integer
FBSTP	Store BCD to integer and pop stack
Exchange
FXCH	Exchange top two stack elements
Constants
FLD1	Push 1.0 onto stack
FLDZ	Push 0.0 onto stack
FLDPI	Push pi onto stack
FLDL2E	Push base-2 log of e onto stack
FLDL2T	Push base-2 log of 10 onto stack
FLDLG2	Push base-10 log of 2 onto stack
FLDLN2	Push natural log of 2 onto stack


 Arithmetic

Add
FADD/FADDP	Add/add and pop
FIADD	Integer add
Subtract
FSUB/FSUBP	Subtract/subtract and pop
FSUBR/FSUBRP	Subtract/subtract and pop with reversed operands
FISUB	Integer subtract
FISUBR	Integer subtract/subtract with reversed operands
Multiply
FMUL/FMULP	Multiply/multiply and pop
FIMUL	Integer multiply
Divide
FDIV/FDIVP	Divide/divide and pop
FIDIV	Integer divide
FDIVR/FDIVRP	Divide/divide and pop with reversed operands
FIDIVR	integer divide with reversed operands
Other
FABS	Calculate absolute value
FCHS	Change sign
FRNDINT	Round to integer
FSQRT	Calculate square root
FSCALE	Scale top of stack by power of 2
FXTRACT	Separate exponent and mantissa
FPREM	Calculate partial remainder
FPREM1	Calculate partial remainder in IEEE format


 Trancendental

Trig
FSIN	Calculate sine
FCOS	Calculate cosine
FSINCOS	Calculate quick sine and cosine
FPTAN	Calculate partial tangent
FPATAN	Calculate partial arctangent
Log
FYL2X	Calculate y times log base 2 of x
FYL2XP1	Calculate y times log base 2 of (x+1)
F2XM1	Calculate (2^x)-1


 Control flow

FCOM	Compare
FCOMP	Compare and pop
FICOM	Integer compare
FTST	Integer compare and pop
FUCOM	Unordered compare
FUCOMP	Unordered compare and pop
FXAM	Set condition code bits for value at top of stack
FSTSW	Store status word


 Environment

FLDCW	Load control word
FSTCW	Store control word
FSTSW	Store status word
FLDENV	Load environment block
FSTENV	Store environment block
FSAVE	Save coprocessor state
FRSTOR	Restore coprocessor state


 System

FINIT	Initialize coprocessor
FCLEX	Clear exception flags
FINCSTP	Increment stack pointer
FDECSTP	Decrement stack pointer
FFREE	Mark element as free
FNOP	No operation
FWAIT	Wait until floating-point instruction complete


F2XM1

  Title:    Calculate 2(^X)-1

  Syntax:   F2XM1

  Description:

Calculates Y = 2(^X) - 1 where X is taken from ST. The result, Y, is returned in ST. X must be in the range 0 <= X <= 0.5 on the 8087/287, or in the range -1.0 <= X <= +1.0 on the 80387/486.

                                    -o-

----------------------------------------------------------------

 F2XM1           | f2xm1                  | 486 140-279

----------------------------------------------------------------

                                    -o-


FABS

  Title:    Absolute Value

  Syntax:   FABS

  Description:

     Converts the element in ST to its absolute value.

                                    -o-

----------------------------------------------------------------

 FABS            | fabs                   | 486 3

----------------------------------------------------------------

                                    -o-


FADD

  Title:    Add

  Syntax:   FADD [dest,src]

            FADDP dest,ST

            FADD src

            FIADD src

  Description:

Adds the source to the destination and returns the sum in the destination. If two register operands are specified, one must be ST. If a memory operand is specified, the sum replaces the value in ST. Memory operands can be 32- or 64-bit real numbers or 16- or 32-bit integers.

If no operand is specified, ST is added to ST(1) and the stack is popped; the sum is returned in ST. For FADDP, the source must be ST; the sum is returned in the destination and ST is popped.

                                    -o-

----------------------------------------------------------------

 FADD [reg,reg] | fadd   st,st(2)         | 486 8-20

                | fadd   st(5),st         |

                | fadd                    |

----------------------------------------------------------------

 FADDP reg,ST   | faddp  st(6),st         | 486 8-20

----------------------------------------------------------------

 FADD memreal   | fadd   QWORD PTR [bx]   | 486 8-20

                | fadd   shortreal        |

----------------------------------------------------------------

 FIADD memint   | fiadd  int16            | 486 w=20-35,d=19-32

                | fiadd  warray[di]       |

                | fiadd  double           |

----------------------------------------------------------------

                                    -o-


FCHS

  Title:    Change Sign

  Syntax:   FCHS

  Description:

     Reverses the sign of the value in ST.

                                    -o-

----------------------------------------------------------------

 FCHS            | fchs                   | 486 6

----------------------------------------------------------------

                                    -o-


FCLEX

  Title:    Clear Exceptions

  Syntax:   FCLEX

            FNCLEX

  Description:

Clears all exception flags, the busy flag, and bit 7 in the status word. Bit 7 is the interrupt-request flag on the 8087 and the error-status flag on the 80287, 80387, and 80486.

This instruction has wait and no-wait versions. The wait version (FCLEX) checks for unmasked numeric errors. The no-wait version (FNCLEX) does not. When the .8087 directive is used, the assembler puts the WAIT instruction before the wait versions and the NOP instruction before the no-wait versions.

                                    -o-

----------------------------------------------------------------

 FCLEX           | fclex                  | 486 7

 FNCLEX          |                        |

----------------------------------------------------------------

  NOTE: The timings reflect the no-wait version of the instruction.

        The wait version may take additional clock cycles.

                                    -o-


FCOM

  Title:    Compare

  Syntax:   FCOM [src]

            FCOMP [src]

            FCOMPP

            FICOM src

            FICOMP src

  Description:

Compares the specified source operand to ST and sets the condition codes of the status word according to the result. The instruction subtracts the source operand from ST without changing either operand. Memory operands can be 32- or 64-bit real numbers or 16- or 32-bit integers.

If no operand is specified or if two pops are specified, ST is compared to ST(1) and the stack is popped. If one pop is specified with an operand, the operand is compared to ST. If one of the operands is a NAN, an invalid-operation exception occurs.

     The condition codes for FCOM are as follows:

     C3     C2     C1     C0     Meaning

     0      0      ?      0      ST > source

     0      0      ?      1      ST < source

     1      0      ?      0      ST = source

     1      1      ?      1      ST not comparable to source

                                    -o-

----------------------------------------------------------------

 FCOM [reg]     | fcom   st(2)            | 486 4

                | fcom                    |

----------------------------------------------------------------

 FCOMP [reg]    | fcomp  st(7)            | 486 4

                | fcomp                   |

----------------------------------------------------------------

 FCOMPP         | fcompp                  | 486 5

----------------------------------------------------------------

 FCOM memreal   | fcom   shortreals[di]   | 486 4

                | fcom   longreal         |

----------------------------------------------------------------

 FCOMP memreal  | fcomp  longreal         | 486 4

                | fcomp  shorts[di]       |

----------------------------------------------------------------

 FICOM memint   | ficom  double           | 486 w=16-20,d=15-17

                | ficom  warray[di]       |

----------------------------------------------------------------

 FICOMP memint  | ficomp WORD PTR [bp+6]  | 486 w=16-20,d=15-17

                | ficomp darray[di]       |

----------------------------------------------------------------

                                    -o-


FSIN

  Title:    Sine/Cosine

  Syntax:   FSIN

            FCOS

            FSINCOS

  Description:

FSIN replaces a value in radians in ST with its sine. FCOS replaces a value in radians in ST with its cosine. FSINCOS calculates the sine and cosine of a radian value in ST. The sine replaces the value in ST, and then the cosine is pushed onto the stack.

If |ST| < 2^63, the C2 bit of the status word is cleared and the sine and/or cosine is calculated. Otherwise, C2 is set and no calculation is performed. ST can be reduced to the required range with FPREM or FPREM1.

                                    -o-

----------------------------------------------------------------

 FSIN           | fsin                    | 486 257-354 *

----------------------------------------------------------------

 FCOS           | fcos                    | 486 257-354 *

----------------------------------------------------------------

 FSINCOS        | fsincos                 | 486 292-365 *

----------------------------------------------------------------

  * For operands with an absolute value greater than pi/4, add n clocks

    where n = operand / (pi/4).

                                    -o-


FINCSTP

  Title:    Increment or Decrement Stack Pointer

  Syntax:   FINCSTP

            FDECSTP

  Description:

Increments or decrements the stack-top pointer in the status word. No tags or registers are changed, and no data is transferred. If the stack pointer is 7, FINCSTP changes it to 0. If the stack pointer is 0, FDECSTP changes it to 7.

                                    -o-

----------------------------------------------------------------

 FINCSTP        | fincstp                 | 486 3

----------------------------------------------------------------

 FDECSTP        | fdecstp                 | 486 3

----------------------------------------------------------------

                                    -o-


FDIV

  Title:    Divide

  Syntax:   FDIV [dest,src]

            FDIVP dest,ST

            FDIV src

            FIDIV src

  Description:

Divides the destination by the source and returns the quotient in the destination. If two register operands are specified, one must be ST. If a memory operand is specified, the quotient replaces the value in ST. Memory operands can be 32- or 64-bit real numbers or 16- or 32-bit integers.

If no operand is specified, ST(1) is divided by ST and the stack is popped; the result is returned in ST. For FDIVP, the source must be ST; the quotient is returned in the destination register and ST is popped.

                                    -o-

----------------------------------------------------------------

 FDIV [reg,reg] | fdiv   st,st(2)         | 486 73

                | fdiv   st(5),st         |

                | fdiv                    |

----------------------------------------------------------------

 FDIVP reg,ST   | fdivp  st(6),st         | 486 73

----------------------------------------------------------------

 FDIV memreal   | fdiv   DWORD PTR [bx]   | 486 73

                | fdiv   shortreal[di]    |

                | fdiv   longreal         |

----------------------------------------------------------------

 FIDIV memint   | fidiv  int16            | 486 w=85-89,d=84-86

                | fidiv  warray[di]       |

                | fidiv  double           |

----------------------------------------------------------------

                                    -o-


FDIVR

  Title:    Divide Reversed

  Syntax:   FDIVR [dest,src]

            FDIVRP dest,ST

            FDIVR src

            FIDIVR src

  Description:

Divides the source by the destination and returns the quotient in the destination. If two register operands are specified, one must be ST. If a memory operand is specified, the quotient replaces the value in ST. Memory operands can be 32- or 64-bit real numbers or 16- or 32-bit integers.

If no operand is specified, ST is divided by ST(1) and the stack is popped; the result is returned in ST. For FDIVRP, the source must be ST; the quotient is returned in the destination register and ST is popped.

                                    -o-

----------------------------------------------------------------

 FDIVR [reg,reg]| fdivr  st,st(2)         | 486 73

                | fdivr  st(5),st         |

                | fdivr                   |

----------------------------------------------------------------

 FDIVRP reg,ST  | fdivrp st(6),st         | 486 73

----------------------------------------------------------------

 FDIVR memreal  | fdivr  longreal         | 486 73

                | fdivr  shortreal[di]    |

----------------------------------------------------------------

 FIDIVR memint  | fidivr double           | 486 w=85-89,d=84-86

                | fidivr warray[di]       |

----------------------------------------------------------------

                                    -o-


FFREE

  Title:    Free Register

  Syntax:   FFREE dest

  Description:

Changes the specified register's tag to empty without changing the contents of the register.

                                    -o-

----------------------------------------------------------------

 FFREE ST(i)    | ffree  st(3)            | 486 3

----------------------------------------------------------------

                                    -o-


FINIT

  Title:    Initialize Coprocessor

  Syntax:    FINIT

             FNINIT

  Description:

Initializes the coprocessor and resets all the registers and flags to their default values. On the 80387/486, the condition codes of the status word are cleared. On the 8087/287, they are unchanged.

This instruction has wait and no-wait versions. The wait version (FINIT) checks for unmasked numeric errors; the no-wait version (FNINIT) does not. When the .8087 directive is used, the assembler puts the WAIT instruction before the wait versions and the NOP instruction before the no-wait versions.

                                    -o-

----------------------------------------------------------------

 FINIT          | finit                   | 486 17

 FNINIT         |                         |

----------------------------------------------------------------

  NOTE: The timings reflect the no-wait version of the instruction.

        The wait version may take additional clock cycles.

                                    -o-


FLD

  Title:    Load

  Syntax:   FLD src

            FILD src

            FBLD src

  Description:

Pushes the specified operand onto the stack. All memory operands are automatically converted to temporary-real numbers before being loaded.

Memory operands can be 32-, 64-, or 80-bit real numbers or 16-, 32-, or 64-bit integers.

                                    -o-

---------------------------------------------------------------

 FLD reg      | fld   st(3)            | 486  4

---------------------------------------------------------------

 FLD memreal  | fld   longreal         | 486 s=3,l=3,t=6

              | fld   shortarray[bx+di]|

              | fld   tempreal         |

---------------------------------------------------------------

 FILD memint  | fild  mem16            | 486 w=13-16,d=9-12,q=10-18

              | fild  DWORD PTR [bx]   |

              | fild  quads[si]        |

---------------------------------------------------------------

 FBLD membcd  | fbld  packbcd          | 486 70-103

---------------------------------------------------------------

                                    -o-


FLD1

  Title:    Load Constant

  Syntax:   FLDconst

  Description:

     Pushes a constant onto the stack. The following constants can be

     loaded:

     Instruction     Constant

     FLD1            +1.0

     FLDZ            +0.0

     FLDPI           pi

     FLDL2E          Log2(e)

     FLDL2T          Log2(10)

     FLDLG2          Log10(2)

     FLDLN2          Loge(2)

                                    -o-

----------------------------------------------------------------

 FLD1           | fld1                    | 486 4

----------------------------------------------------------------

 FLDZ           | fldz                    | 486 4

----------------------------------------------------------------

 FLDPI          | fldpi                   | 486 8

----------------------------------------------------------------

 FLDL2E         | fldl2e                  | 486 8

----------------------------------------------------------------

 FLDL2T         | fldl2t                  | 486 8

----------------------------------------------------------------

 FLDLG2         | fldlg2                  | 486 8

----------------------------------------------------------------

 FLDLN2         | fldln2                  | 486 8

----------------------------------------------------------------

                                    -o-


FLDCW

  Title:    Load or Store Control Word

  Syntax:   FLDCW src

            FSTCW dest

            FNSTCW dest

  Description:

FLDCW loads the specified word into the coprocessor control word. FSTCW stores the control word to a specified 16-bit memory operand.

FSTCW has wait and no-wait versions. The wait version (FSTCW) checks for unmasked numeric errors; the no-wait version (FNSTCW) does not. When the .8087 directive is used, the assembler puts the WAIT instruction before the wait version and the NOP instruction before the no-wait version.

                                    -o-

----------------------------------------------------------------

 FLDCW mem16    | fldcw  ctrlword         | 486 4

----------------------------------------------------------------

 FSTCW mem16    | fstcw  ctrlword         | 486 3

 FNSTCW mem16   |                         |

----------------------------------------------------------------

  NOTE: The timings reflect the no-wait version of the FSTCW. The wait

        version may take additional clock cycles.

                                    -o-


FSTENV

  Title:    Load or Store Environment State

  Syntax:   FSTENV dest

            FNSTENV dest

            FLDENV mem

  Description:

FSTENV stores the 14-byte coprocessor environment state to a specified memory location. FLDENV loads it from a specified memory location.

The environment state includes the control word, status word, tag word, instruction pointer, and operand pointer. On the 80387/486 in 32-bit mode, the environment state is 28 bytes.

The FSTENV instruction has wait and no-wait versions. The wait version (FSTENV) checks for unmasked numeric errors; the no-wait version (FNSTENV) does not. When the .8087 directive is used, the assembler puts the WAIT instruction before the wait version and the NOP instruction before the no-wait version.

                                    -o-

----------------------------------------------------------------

 FLDENV mem     | fldenv [bp+10]          | 486 44,pm=34

 FLDENVW mem    |                         |

 FLDENVD mem    |                         |

----------------------------------------------------------------

 FSTENV mem     | fstenv [bp-14]          | 486 67,pm=56

 FSTENVW mem    |                         |

 FSTENVD mem    |                         |

 FNSTENV mem    |                         |

 FNSTENVW mem   |                         |

 FNSTENVD mem   |                         |

----------------------------------------------------------------

  NOTE: The timings reflect the no-wait versions of FSTENV. The wait

        versions may take additional clock cycles.

                                    -o-


FMUL

  Title:    Multiply

  Syntax:   FMUL [dest,src]

            FMULP dest,ST

            FMUL src

            FIMUL src

  Description:

Multiplies the source by the destination and returns the product in the destination. If two register operands are specified, one must be ST. If a memory operand is specified, the product replaces the value in ST. Memory operands can be 32- or 64-bit real numbers or 16- or 32-bit integers.

If no operand is specified, ST(1) is multiplied by ST and the stack is popped; the product is returned in ST. For FMULP, the source must be ST; the product is returned in the destination register and ST is popped.

                                    -o-

----------------------------------------------------------------

 FMUL [reg,reg] | fmul   st,st(2)        | 486 16

                | fmul   st(5),st        |

                | fmul                   |

----------------------------------------------------------------

 FMULP reg,ST   | fmulp  st(6),st        | 486 16

----------------------------------------------------------------

 FMUL memreal   | fmul   DWORD PTR [bx]  | 486 s=11,l=14

                | fmul   shortreal[di+3] |

                | fmul   longreal        |

                |                        |

----------------------------------------------------------------

 FIMUL memint   | fimul  int16           | 486 w=23-27,d=22-24

                | fimul  warray[di]      |

                | fimul  double          |

                |                        |

----------------------------------------------------------------

  * The clocks in parentheses show times for short values--those with 40

    trailing zeros in their fraction because they were loaded from a

    short-real memory operand.

  œ The clocks in parentheses show typical speeds.

  _ If the register operand is a short value--having 40 trailing zeros

    in its fraction because it was loaded from a short-real memory

    operand--then the timing is (112-126)+EA on the 8087 or 112-126 on

    the 80287.

                                    -o-


FNOP

  Title:    No Operation

  Syntax:   FNOP

  Description:

Performs no operation. FNOP can be used for timing delays or alignment.

                                    -o-

----------------------------------------------------------------

 FNOP           | fnop                    | 486 3

----------------------------------------------------------------

                                    -o-


FPATAN

  Title:    Partial Arctangent and Tangent

  Syntax:   FPATAN

            FPTAN

  Description:

FPATAN finds the partial tangent by calculating Z = ARCTAN(Y / X) where X is taken from ST and Y from ST(1). On the 8087/287, Y and X must be in the range 0 <= Y < X < infinity. On the 80387/486, there is no restriction on X and Y. X is popped from the stack and Z replaces Y in ST.

FPTAN finds the partial tangent by calculating Y / X = TAN(Z). Z is taken from ST. Z must be in the range 0 <= Z <= pi/4 on the 8087/287. On the 80387/486, |Z| must be less than 2^63. The result is the ratio Y / X. Y replaces Z, and X is pushed into ST. Thus, Y is returned in ST(1) and X in ST.

                                    -o-

----------------------------------------------------------------

 FPATAN         | fpatan                  | 218-303

----------------------------------------------------------------

 FPTAN          | fptan                   | 486 200-273 *

----------------------------------------------------------------

  * For operands with an absolute value greater than pi/4, add n clocks

    where n = operand / (pi/4).

                                    -o-


FPREM

  Title:    Partial Remainder

  Syntax:   FPREM

            FPREM1 (80387/487 only)

  Description:

Calculates the remainder of ST divided by ST(1); the result is returned in ST. The remainder retains the same sign as the original dividend. The calculation uses the following formula:

          remainder = ST - ST(1) * quotient

For FPREM, the quotient is the exact value obtained by chopping ST / ST(1) toward 0. For FPREM1, the quotient is the integer nearest to the exact value of ST / ST(1). When two integers are equally close to the given value, the even integer is used. FPREM1 conforms to the IEEE standard.

These instructions are normally used in a loop that repeats until the reduction is complete, as indicated by the condition codes of the status word.

     The condition codes for FPREM and FPREM1 are as follows:

     C3     C2     C1     C0     Meaning

     ?      1      ?      ?      Incomplete reduction

     0      0      0      0      Quotient MOD 8 = 0

     0      0      0      1      Quotient MOD 8 = 4

     0      0      1      0      Quotient MOD 8 = 1

     0      0      1      1      Quotient MOD 8 = 5

     1      0      0      0      Quotient MOD 8 = 2

     1      0      0      1      Quotient MOD 8 = 6

     1      0      1      0      Quotient MOD 8 = 3

     1      0      1      1      Quotient MOD 8 = 7

                                    -o-

----------------------------------------------------------------

 FPREM          | fprem                   | 486 70-138

----------------------------------------------------------------

 FPREM1         | fprem1                  | 486 72-167

----------------------------------------------------------------

                                    -o-


FRNDINT

  Title:    Round to Integer

  Syntax:   FRNDINT

  Description:

Rounds ST from a real number to an integer. The rounding control (RC) field of the control word specifies the rounding method.

                                    -o-

----------------------------------------------------------------

 FRNDINT        | frndint                 | 486 21-30

----------------------------------------------------------------

                                    -o-


FSAVE

  Title:    Save or Restore Coprocessor State

  Syntax:   FSAVE dest

            FNSAVE dest

            FRSTOR src

  Description:

FSAVE stores the 94-byte coprocessor state to a specified memory location; FRSTOR restores it from a specified memory location.

In 32-bit mode on the 80387/486, the environment state takes 108 bytes.

FSAVE has wait and no-wait versions. The wait version (FSAVE) checks for unmasked numeric errors; the no-wait version (FNSAVE) does not. After saving the state, the coprocessor is initialized as if FINIT had been executed.

When the .8087 directive is used, the assembler puts the WAIT instruction before the wait version and the NOP instruction before the no-wait version.

                                    -o-

----------------------------------------------------------------

 FSAVE mem      | fsave  [bp-94]          | 486 154,pm=143

 FSAVEW mem*    | fsave  cobuffer         | 486 154,pm=143

 FSAVED mem*    |                         |

 FNSAVE mem     |                         |

 FNSAVEW mem*   |                         |

 FNSAVED mem*   |                         |

----------------------------------------------------------------

 FRSTOR mem     | frstor [bp-94]          | 486 131,pm=120

----------------------------------------------------------------

  * 80387/486 only.

  œ Clock counts are not meaningful in determining overall execution

    time of this instruction. Timing is determined by operand

    transfers.

  NOTE: The timings reflect the no-wait versions of FSAVE. The wait

        versions may take additional clock cycles.

                                    -o-


FSCALE

  Title:    Scale

  Syntax:   FSCALE

  Description:

Scales by powers of 2 by calculating the function Y = Y * 2^X. X is the scaling factor taken from ST(1), and Y is the value to be scaled from ST. The scaled result replaces the value in ST; the scaling factor remains in ST(1). If the scaling factor is not an integer, it will be truncated toward zero before the scaling.

On the 8087/287 processors, if X is not in the range -2^15 <= X < 2^15 or if X is in the range 0 < X < 1, the result will be undefined. The 80387/486 processors have no restrictions on the range of operands.

                                    -o-

----------------------------------------------------------------

 FSCALE         | fscale                  | 486 30-32

----------------------------------------------------------------

                                    -o-


FSETPM

  Title:    Set Protected Mode

            80287 Only

  Syntax:   FSETPM

  Description:

Sets the 80287 to protected mode. The instruction and operand pointers are in the protected-mode format after this instruction. On the 80387/486, FSETPM is recognized but interpreted as the FNOP instruction, since the 80386/486 processors handle addressing identically in real and protected modes.

                                    -o-

----------------------------------------------------------------

 FSETPM         | fsetpm                  | 486 3

----------------------------------------------------------------

                                    -o-


FSQRT

  Title:    Square Root

  Syntax:   FSQRT

  Description:

Replaces the value of ST with its square root. The square root of -0 is -0.                                     -o-

----------------------------------------------------------------

 FSQRT          | fsqrt                   | 486 83-87

----------------------------------------------------------------

                                    -o-


FST

  Title:    Store

  Syntax:   FST dest

            FSTP dest

            FIST dest

            FISTP dest

            FBSTP dest

  Description:

Stores the value in ST to the specified memory location or register. Temporary-real values in registers are converted to the appropriate integer, BCD, or floating-point format as they are stored. With FSTP, FISTP, and FBSTP, the ST register value is popped off the stack.

Memory operands can be 32-, 64-, or 80-bit real numbers for FSTP, or 16-, 32-, or 64-bit integers for FISTP.

                                    -o-

----------------------------------------------------------------

 FST reg       | fst    st(6)          | 486 3

               | fst    st             | 486 3

----------------------------------------------------------------

 FSTP reg      | fstp   st             | 486 3

               | fstp   st(3)          | 486 3

----------------------------------------------------------------

 FST memreal   | fst    shortreal      | 486 s=7,l=8

               | fst    longs[bx]      | 486 s=7,l=8

----------------------------------------------------------------

 FSTP memreal  | fstp   longreal       | 486 s=7,l=8,t=6

               | fstp   tempreals[bx]  | 486 s=7,l=8,t=6

----------------------------------------------------------------

 FIST memint   | fist   int16          | 486 w=29-34,d=28-34

               | fist   doubles[8]     | 486 w=29-34,d=28-34

----------------------------------------------------------------

 FISTP memint  | fistp  longint        | 486 29-34

               | fistp  doubles[bx]    | 486 29-34

----------------------------------------------------------------

 FBSTP membcd  | fbstp  bcds[bx]       | 486 172-176

----------------------------------------------------------------

                                    -o-


FSTSW

  Title:    Store Status Word

  Syntax:   FSTSW dest

            FNSTSW dest

  Description:

Stores the status word to a specified 16-bit memory operand. On the 80287, 80387, and 80486, the status word can also be stored to the processor's AX register.

FSTSW has wait and no-wait versions. The wait version (FSTSW) checks for unmasked numeric errors; the no-wait version (FNSTSW) does not. When the .8087 directive is used, the assembler puts the WAIT instruction before the wait version and the NOP instruction before the no-wait version.

                                    -o-

----------------------------------------------------------------

 FSTSW mem16    | fstsw  statword         | 486 3

 FNSTSW mem16   |                         | 486 3

----------------------------------------------------------------

 FSTSW AX       | fstsw  ax               | 486 3

 FNSTSW AX      |                         | 486 3

----------------------------------------------------------------

  NOTE: The timings reflect the no-wait version of the instruction.

        The wait version may take additional clock cycles.

                                    -o-


FSUB

  Title:    Subtract

  Syntax:   FSUB [dest,src]

            FSUBP dest,ST

            FSUB src

            FISUB src

  Description:

Subtracts the source from the destination and returns the difference in the destination. If two register operands are specified, one must be ST. If a memory operand is specified, the result replaces the value in ST. Memory operands can be 32- or 64-bit real numbers or 16- or 32-bit integers.

If no operand is specified, ST is subtracted from ST(1) and the stack is popped; the difference is returned in ST. For FSUBP, the source must be ST; the difference (destination minus source) is returned in the destination register and ST is popped.

                                    -o-

----------------------------------------------------------------

 FSUB [reg,reg] | fsub   st,st(2)         | 486 8-20

----------------------------------------------------------------

 FSUBP reg,ST   | fsubp  st(6),st         | 486 8-20

----------------------------------------------------------------

 FSUB memreal   | fsub   longreal         | 486 8-20

----------------------------------------------------------------

 FISUB memint   | fisub  double           | 486 w=20-35,d=19-32

----------------------------------------------------------------

                                    -o-


FSUBR

  Title:    Subtract Reversed

  Syntax:   FSUBR [dest,src]

            FSUBRP dest,ST

            FSUBR src

            FISUBR src

  Description:

Subtracts the destination operand from the source operand and returns the result in the destination operand. If two register operands are specified, one must be ST. If a memory operand is specified, the result replaces the value in ST. Memory operands can be 32- or 64-bit real numbers or 16- or 32-bit integers.

If no operand is specified, ST(1) is subtracted from ST and the stack is popped; the difference is returned in ST. For FSUBRP, the source must be ST; the difference (source minus destination) is returned in the destination register and ST is popped.

                                    -o-

----------------------------------------------------------------

 FSUBR [reg,reg]| fsubr  st,st(2)         | 486 8-20

----------------------------------------------------------------

 FSUBRP reg,ST  | fsubrp st(6),st         | 486 8-20

----------------------------------------------------------------

 FSUBR memreal  | fsubr  QWORD PTR [bx]   | 486 8-20

----------------------------------------------------------------

 FISUBR memint  | fisubr int16            | 486 w=20-35,d=19-32

----------------------------------------------------------------

                                    -o-


FTST

  Title:    Test for Zero

  Syntax:   FTST

  Description:

Compares ST with +0.0 and sets the condition of the status word according to the result.

     The condition codes for FTST are as follows:

     C3     C2     C1     C0     Meaning

     0      0      ?      0      ST is positive

     0      0      ?      1      ST is negative

     1      0      ?      0      ST is 0

     1      1      ?      1      ST is not comparable (NAN or

                                 projective infinity)

                                    -o-

----------------------------------------------------------------

 FTST           | ftst                    | 486 4

----------------------------------------------------------------

                                    -o-


FUCOM

  Title:    Unordered Compare

  Syntax:   FUCOM [src]

            FUCOMP [src]

            FUCOMPP

  Description:

Compares the specified source to ST and sets the condition codes of the status word according to the result. The instruction subtracts the source operand from ST without changing either operand. Memory operands are not allowed.

If no operand is specified or if two pops are specified, ST is compared to ST(1). If one pop is specified with an operand, the given register is compared to ST.

Unlike FCOM, FUCOM does not cause an invalid-operation exception if one of the operands is a NAN. Instead, the condition codes are set to unordered.

     The condition codes for FUCOM are as follows:

     C3     C2     C1     C0     Meaning

     0      0      ?      0      ST > source

     0      0      ?      1      ST < source

     1      0      ?      0      ST = source

     1      1      ?      1      Unordered

                                    -o-

----------------------------------------------------------------

 FUCOM [reg]    | fucom  st(2)            | 486 4

----------------------------------------------------------------

 FUCOMP [reg]   | fucomp st(7)            | 486 4

----------------------------------------------------------------

 FUCOMPP        | fucompp                 | 486 5

----------------------------------------------------------------

                                    -o-


FWAIT

  Title:    Wait

  Syntax:   FWAIT

  Description:

Suspends execution of the processor until the coprocessor is finished executing. This is an alternate mnemonic for the processor WAIT instruction.                                     -o-

----------------------------------------------------------------

 FWAIT          | fwait                   | 486 1-3

----------------------------------------------------------------

                                    -o-


FXAM

  Title:    Examine

  Syntax:   FXAM

  Description:

     Reports the contents of ST in the condition flags of the status

     word.

     The condition codes for FXAM are as follows:

     C3     C2     C1     C0     Meaning

     0      0      0      0      + Unnormal*

     0      0      0      1      + NAN

     0      0      1      0      - Unnormal*

     0      0      1      1      - NAN

     0      1      0      0      + Normal

     0      1      0      1      + Infinity

     0      1      1      0      - Normal

     0      1      1      1      - Infinity

     1      0      0      0      + 0

     1      0      0      1      Empty

     1      0      1      0      - 0

     1      0      1      1      Empty

     1      1      0      0      + Denormal

     1      1      0      1      Empty*

     1      1      1      0      - Denormal

     1      1      1      1      Empty*

* Not used on the 80387/486 processors. Unnormals are not supported by the 80387/486. Also, the 80387/486 processors use two codes instead of four to identify empty registers.                                     -o-

----------------------------------------------------------------

 FXAM           | fxam                    | 486 8

----------------------------------------------------------------

                                    -o-


FXCH

  Title:    Exchange Registers

  Syntax:   FXCH [dest]

  Description:

Exchanges the specified (destination) register and ST. If no operand is specified, ST and ST(1) are exchanged.                                     -o-

----------------------------------------------------------------

 FXCH [reg]     | fxch   st(3)            | 486 4

----------------------------------------------------------------

                                    -o-


FXTRACT

  Title:    Extract Exponent and Significand

  Syntax:   FXTRACT

  Description:

Extracts the exponent and significand (mantissa) fields of ST. The exponent replaces the value in ST, and then the significand is pushed onto the stack.                                     -o-

----------------------------------------------------------------

 FXTRACT        | fxtract                 | 486 16-20

----------------------------------------------------------------

                                    -o-


FYL2X

  Title:    Y log(sub2)(X)

  Syntax:   FYL2X

  Description:

Calculates Z = Y log(sub2)(X) where X is taken from ST and Y from ST(1). The stack is popped and the result, Z, replaces Y in ST. X must be in the range 0 < X < infinity and Y in the range minus infinity < Y < infinity.                                     -o-

----------------------------------------------------------------

 FYL2X          | fyl2x                   | 486 196-329

----------------------------------------------------------------

                                    -o-


FYL2XP1

  Title:    Y log(sub2)(X+1)

  Syntax:   FYL2XP1

  Description:

Calculates Z = Y log(sub2)(X + 1) where X is taken from ST and Y from ST(1). The stack is popped once and the result, Z, replaces Y in ST. X must be in the range 0 <= |X| < (1 - (SQRT2 / 2)) and Y in the range minus infinity < Y < infinity.                                     -o-

----------------------------------------------------------------

 FYL2XP1        | fyl2xp                  | 486 171-326

----------------------------------------------------------------

                                    -o-