وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

FSTP

FSTP 

Usage: FSTP dest                                     Modifies flags: See below

Copies the value in the ST(0) register to the 'dest'  operand, which can be a memory location or another register in the FPU register stack. When storing the value in memory, the value is converted to single-precision or double-precision floating-point format.

Floating-Point Store


FST mem32                     ; D9 /2                [8086,FPU]

FST mem64                     ; DD /2                [8086,FPU]

FST fpureg                    ; DD D0+r              [8086,FPU]


FSTP mem32                    ; D9 /3                [8086,FPU]

FSTP mem64                    ; DD /3                [8086,FPU]

FSTP mem80                    ; DB /7                [8086,FPU]

FSTP fpureg                   ; DD D8+r              [8086,FPU]


FST stores the value in ST0 into the given memory location or other FPU register. FSTP does the same, but then pops the register stack.


 FPU Flags Affected C1 Set to 0 if stack underflow occurred. Indicates rounding direction of if the floating-point inexact exception (#P) is generated: 0 = not roundup; 

1 =roundup. C0, C2, C3 Undefined.


EXAMPLE:

fstp Label


FSTENV / FNSTENV

FSTENV / FNSTENV

Usage: FSTENV src                                           Modifies flags: None

Saves the current FPU operating environment at the memory location specified with the 'dest'  operand, and then masks all floating-point exceptions. The FPU operating environment consists of the FPU control word, status word, tag word, instruction pointer, data pointer, and last opcode.

Store Floating-Point Environment


FSTENV  mem                   ; 9B D9 /6             [8086,FPU]

FNSTENV mem                   ; D9 /6                [8086,FPU]


FSTENV stores the FPU operating environment (control word, status word, tag word, instruction pointer, data pointer and last opcode) into memory. The memory area is 14 or 28 bytes long, depending on the CPU mode at the time. See also FLDENV.


FNSTENV does the same thing as FSTENV, without first waiting for pending floating-point exceptions to clear.


EXAMPLE:

fstenv   Label

fnstenv Label


FSTCW / FNSTCW

FSTCW / FNSTCW

Usage: FSTCW src                                           Modifies flags: None

          FNSTCW src

Stores the current value of the FPU control word at the specified destination in memory. The FSTCW instruction checks for and handles pending unmasked floating-point exceptions before storing the control word; the FNSTCW instruction does not.

Store Floating-Point Control Word


FSTCW mem16                   ; 9B D9 /7             [8086,FPU]

FNSTCW mem16                  ; D9 /7                [8086,FPU]


FSTCW stores the FPU control word (governing things like the rounding mode, the precision, and the exception masks) into a 2-byte memory area. See also FLDCW.


FNSTCW does the same thing as FSTCW, without first waiting for pending floating-point exceptions to clear.


EXAMPLE:

fstcw

fnstcw

 

FST

FST 

Usage: FST dest                                           Modifies flags: See below

Copies the value in the ST(0) register to the 'dest'  operand, which can be a memory location or another register in the FPU register stack. When storing the value in memory, the value is converted to single-precision or double-precision floating-point format.

Floating-Point Store


FST mem32                     ; D9 /2                [8086,FPU]

FST mem64                     ; DD /2                [8086,FPU]

FST fpureg                    ; DD D0+r              [8086,FPU]


FSTP mem32                    ; D9 /3                [8086,FPU]

FSTP mem64                    ; DD /3                [8086,FPU]

FSTP mem80                    ; DB /7                [8086,FPU]

FSTP fpureg                   ; DD D8+r              [8086,FPU]


FST stores the value in ST0 into the given memory location or other FPU register. FSTP does the same, but then pops the register stack.


FPU Flags Affected C1 Set to 0 if stack underflow occurred. Indicates rounding direction of if the floating-point inexact exception (#P) is generated:  0 = not roundup; 1 =roundup. C0, C2, C3 Undefined.


EXAMPLE:

fst Label

FST

FSQRT

FSQRT 

Usage: FSQRT src                                     Modifies flags: None

Computes the square root of the 'src' value in the ST(0) register and stores the result in ST(0).

Floating-Point Square Root


FSQRT                         ; D9 FA                [8086,FPU]


FSQRT calculates the square root of ST0 and stores the result in ST0.


EXAMPLE:

fsqrt


FSINCOS

FSINCOS 

Usage:   FSINCOS   src                               Modifies flags: See below.

Computes both the sine and the cosine of the source operand in register ST(0), stores the sine in ST(0), and pushes the cosine onto the top of the FPU register stack. 

Sine and Cosine


FSIN                          ; D9 FE                [386,FPU]

FSINCOS                       ; D9 FB                [386,FPU]


FSIN calculates the sine of ST0 (in radians) and stores the result in ST0. FSINCOS does the same, but then pushes the cosine of the same value on the register stack, so that the sine ends up in ST1 and the cosine in ST0. FSINCOS is faster than executing FSIN and FCOS in succession.


The absolute value of ST0 must be less than 2**63.


FPU Flags Affected C1 Set to 0 if stack underflow occurred; set to 1 of stack overflow occurs. Set if result was rounded up; cleared otherwise. C2 Set to 1 if outside range (-2 63 <source operand <+2 63 ); otherwise, set to 0. C0, C3 Undefined.


Example:

fsincos Label 


FSIN

FSIN 

Usage: FSIN src                                        Modifies flags: See below.

Computes the sine of the 'src' operand in register ST(0) and stores the result in ST(0). The 'src' operand must be given in radians and must be within the range -2**63 to +2**63 . 

Sine and Cosine


FSIN                          ; D9 FE                [386,FPU]

FSINCOS                       ; D9 FB                [386,FPU]


FSIN calculates the sine of ST0 (in radians) and stores the result in ST0. FSINCOS does the same, but then pushes the cosine of the same value on the register stack, so that the sine ends up in ST1 and the cosine in ST0. FSINCOS is faster than executing FSIN and FCOS in succession.


The absolute value of ST0 must be less than 2**63.


FPU Flags Affected C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C2 Set to 1 if outside range (-2 63 <source operand <+2 63 ); otherwise, set to 0. C0, C3 Undefined. 


EXAMPLE:

fsin Label


FSETPM

FSETPM 

Set Protected Mode



FSETPM                        ; DB E4                [286,FPU]


This instruction initializes protected mode on the 287 floating-point coprocessor. It is only meaningful on that processor: the 387 and above treat the instruction as a no-operation.


 

FSCALE

FSCALE 

Usage:   FSCALE   dest,src                                Modifies flags: See below.

Truncates the value in the 'src' operand (toward 0) to an integral value and adds that value to the exponent of the 'dest' operand. The 'dest' and 'src' operands are floating-point values located in registers ST(0) and ST(1), respectively. This instruction provides rapid multiplication or division by integral powers of 2.

Scale Floating-Point Value by Power of Two


FSCALE                        ; D9 FD                [8086,FPU]


FSCALE scales a number by a power of two: it rounds ST1  towards zero to obtain an integer, then multiplies ST0 by two to the power of that integer, and stores the result in ST0.


FPU Flags Affected C1 Set to 0 if stack underflow occurred. Set if result was rounded up; cleared otherwise. C0, C2, C3 Undefined.


Example:

fscale 


FRSTOR

FRSTOR 

Usage:   FRSTOR   src                               Modifies flags: The C0, C1, C2, C3 flags are loaded.

Loads the FPU state (operating environment and register stack) from the memory area specified with the 'src' operand. This state data is typically written to the specified memory location by a previous FSAVE/FNSAVE instruction.

Save/Restore Floating-Point State


FSAVE mem                     ; 9B DD /6             [8086,FPU]

FNSAVE mem                    ; DD /6                [8086,FPU]


FRSTOR mem                    ; DD /4                [8086,FPU]


FSAVE saves the entire floating-point unit state, including all the information saved by FSTENV ( FSTENV) plus the contents of all the registers, to a 94 or 108 byte area of memory (depending on the CPU mode). FRSTOR restores the floating-point state from the same area of memory. Label


FNSAVE does the same as FSAVE, without first waiting for pending floating-point exceptions to clear.


If one or more unmasked exception bits are set in the new FPU status word, a floating-point exception will be generated. To avoid raising exceptions when loading a new operating environment, clear all the exception flags in the FPU status word that is being loaded.


Example:

frstor Label