FNINIT
Usage: FNINIT Modifies flags: See below
Sets the FPU control, status, tag, instruction pointer, and data pointer registers to their default states. The FPU control word is set to 037FH (round to nearest, all exceptions masked, 64-bit precision). The status word is cleared (no exception flags set, TOP is set to 0). The data registers in the register stack are left unchanged, but they are all tagged as empty (11B). Both the instruction and data pointers are cleared.
Initialize Floating-Point Unit
FINIT ; 9B DB E3 [8086,FPU]
FNINIT ; DB E3 [8086,FPU]
FINIT initializes the FPU to its default state. It flags all registers as empty, without actually changing their values, clears the top of stack pointer. FNINIT does the same, without first waiting for pending exceptions to clear.
FPU Flags Affected C0, C1, C2, C3 set to 0.
EXAMPLE:
fninit
FMULP
Usage: FMULP dest,src Modifies flags: None
Multiplies the 'dest' and 'src' operands and stores the product in the 'dest' location. The 'dest' operand is always an FPU data register; the 'src' operand can be an FPU data register or a memory location.
Floating-Point Multiply
FMUL mem32 ; D8 /1 [8086,FPU]
FMUL mem64 ; DC /1 [8086,FPU]
FMUL fpureg ; D8 C8+r [8086,FPU]
FMUL ST0,fpureg ; D8 C8+r [8086,FPU]
FMUL TO fpureg ; DC C8+r [8086,FPU]
FMUL fpureg,ST0 ; DC C8+r [8086,FPU]
FMULP fpureg ; DE C8+r [8086,FPU]
FMULP fpureg,ST0 ; DE C8+r [8086,FPU]
FMUL multiplies ST0 by the given operand, and stores the result in ST0, unless the TO qualifier is used in which case it stores the result in the operand. FMULP performs the same operation as FMUL TO, and then pops the register stack.
Source operands in memory can be in single-precision or double-precision floating-point format or in word or doubleword integer format.
FPU Flags Affected C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C0, C2, C3 Undefined.
EXAMPLE:
fmulp Label
FMUL
Usage: FMUL dest,src Modifies flags: None
Multiplies the 'dest' and 'src' operands and stores the product in the 'dest' location. The 'dest' operand is always an FPU data register; the 'src' operand can be an FPU data register or a memory location.
Floating-Point Multiply
FMUL mem32 ; D8 /1 [8086,FPU]
FMUL mem64 ; DC /1 [8086,FPU]
FMUL fpureg ; D8 C8+r [8086,FPU]
FMUL ST0,fpureg ; D8 C8+r [8086,FPU]
FMUL TO fpureg ; DC C8+r [8086,FPU]
FMUL fpureg,ST0 ; DC C8+r [8086,FPU]
FMULP fpureg ; DE C8+r [8086,FPU]
FMULP fpureg,ST0 ; DE C8+r [8086,FPU]
FMUL multiplies ST0 by the given operand, and stores the result in ST0, unless the TO qualifier is used in which case it stores the result in the operand. FMULP performs the same operation as FMUL TO, and then pops the register stack.
Source operands in memory can be in single-precision or double-precision floating-point format or in word or doubleword integer format.
FPU Flags Affected C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C0, C2, C3 Undefined.
EXAMPLE:
fmul Label
FLDxx
Usage: FLDxx Modifies flags: None
Push one of seven commonly used constants (in double extended-precision floating-point format) onto the FPU register stack. For each constant, an internal 66-bit constant is rounded (as specified by the RC field in the FPU control word) to double extended-precision floating-point format.
Floating-Point Load Constants
FLD1 ; D9 E8 [8086,FPU]
FLDL2E ; D9 EA [8086,FPU]
FLDL2T ; D9 E9 [8086,FPU]
FLDLG2 ; D9 EC [8086,FPU]
FLDLN2 ; D9 ED [8086,FPU]
FLDPI ; D9 EB [8086,FPU]
FLDZ ; D9 EE [8086,FPU]
These instructions push specific standard constants on the FPU register stack.
Instruction Constant pushed
FLD1 1
FLDZ zero
FLDPI pi
FLDL2E base-2 logarithm of e
FLDLN2 base-e log of 2
FLDL2T base-2 log of 10
FLDLG2 base-10 log of 2
The inexact-result exception (#P) is not generated as a result of the rounding, nor is the C1 flag set in the x87 FPU status word if the value is rounded up. See the section titled 'Pi' in Chapter 8 of the IA-32 Intel Architecture Software Developer's Manual, Volume 1, for a description of the p constant.
EXAMPLE:
fld2t
FLDENV
Usage: FLDENV src Modifies flags: None
Loads the complete x87 FPU operating environment from memory into the FPU registers. The 'src' operand specifies the first byte of the operating-environment data in memory. This data is typically written to the specified memory location by a FSTENV or FNSTENV instruction.
Load Floating-Point Environment
FLDENV mem ; D9 /4 [8086,FPU]
FLDENV loads the FPU operating environment (control word, status word, tag word, instruction pointer, data pointer and last opcode) from memory. The memory area is 14 or 28 bytes long, depending on the CPU mode at the time. See also FSTENV.
The C0, C1, C2, C3 flags are loaded.
EXAMPLE:
fldenv Label
FLDCW
Usage: FLDCW src Modifies flags:
Loads the 16-bit 'src' operand into the FPU control word. The 'src' operand is a memory location. This instruction is typically used to establish or change the FPU's mode of operation.
Load Floating-Point Control Word
FLDCW mem16 ; D9 /5 [8086,FPU]
FLDCW loads a 16-bit value out of memory and stores it into the FPU control word (governing things like the rounding mode, the precision, and the exception masks). See also FSTCW. If exceptions are enabled and you don't want to generate one, use FCLEX or FNCLEX before loading the new control word.
C0, C1, C2, C3 undefined.
EXAMPLE:
fldcw Label
FLD
Usage: FLD src Modifies flags: See below
Pushes the 'src' operand onto the FPU register stack. The 'src' operand can be in single-precision, double-precision, or double extended-precision floating-point format.
Floating-Point Load
FLD mem32 ; D9 /0 [8086,FPU]
FLD mem64 ; DD /0 [8086,FPU]
FLD mem80 ; DB /5 [8086,FPU]
FLD fpureg ; D9 C0+r [8086,FPU]
FLD loads a floating-point value out of the given register or memory location, and pushes it on the FPU register stack.
If the source operand is in single-precision or double-precision floating-point format, it is automatically converted to the double extended-precision floating-point format before being pushed on the stack. The FLD instruction can also push the value in a selected FPU register [ST(i)] onto the stack. Here, pushing register ST(0) duplicates the stack top.
FPU Flags Affected C1 Set to 1 if stack overflow occurred; otherwise, set to 0.
C0, C2, C3 undefined.
EXAMPLE:
fld Label
FISUBR
Usage: FISUBR dest,src Modifies flags: See below
Subtracts the 'src' operand from the 'dest' and stores the difference in the 'dest' location. The 'dest' operand is always an FPU data register; the 'src' operand can be a register or a memory location.
Floating-Point/Integer Subtraction
FISUB mem16 ; DE /4 [8086,FPU]
FISUB mem32 ; DA /4 [8086,FPU]
FISUBR mem16 ; DE /5 [8086,FPU]
FISUBR mem32 ; DA /5 [8086,FPU]
FISUB subtracts the 16-bit or 32-bit integer stored in the given memory location from ST0, and stores the result in ST0. FISUBR does the subtraction the other way round, i.e. it subtracts ST0 from the given integer, but still stores the result in ST0.
Source operands in memory can be in single-precision or double-precision floating-point format or in word or doubleword integer format.
FPU Flags Affected C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C0, C2, C3 Undefined.
EXAMPLE:
fisubr Label | fisub Label
FISUB
Usage: FISUB dest,src Modifies flags: See below
Subtracts the 'src' operand from the 'dest' and stores the difference in the 'dest' location. The 'dest' operand is always an FPU data register; the 'src' operand can be a register or a memory location.
Floating-Point/Integer Subtraction
FISUB mem16 ; DE /4 [8086,FPU]
FISUB mem32 ; DA /4 [8086,FPU]
FISUBR mem16 ; DE /5 [8086,FPU]
FISUBR mem32 ; DA /5 [8086,FPU]
FISUB subtracts the 16-bit or 32-bit integer stored in the given memory location from ST0, and stores the result in ST0. FISUBR does the subtraction the other way round, i.e. it subtracts ST0 from the given integer, but still stores the result in ST0.
Source operands in memory can be in single-precision or double-precision floating-point format or in word or doubleword integer format.
FPU Flags Affected C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C0, C2, C3 Undefined.
EXAMPLE:
fisub Label | fisubr Label
FISTTP
Usage: FISTTP dest Modifies flags: See below.
Converts the value in ST into a signed integer using truncation (chop) as rounding mode, transfers the result to the destination, and pops ST.
Store Integer with Truncation
FISTTP Mem16int ; DF/1 [Pent4]
FISTTP Mem32int ; DB/1 [Pent4]
FISTTP Mem64int ; DD/1 [Pent4]
FISTTP does a conversion of ST into a signed integer truncating and storing the result in the destination then pops ST.
FISTTP accepts word, short integer, and long integer destinations.
Flags Affected
C1 is cleared; C0, C2, C3 undefined.
EXAMPLE:
fisttp Label