Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- iAPx86 - <b>fsave save fpu state exceptions: none</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FSAVE           Save FPU state                       Exceptions: None
FNSAVE          Save FPU state, no wait              C3 C2 C1 C0: 0 0 0 0

FSAVE destination
FNSAVE destination

        Logic   destination . FPU state

    FSAVE/FNSAVE write the FPU state to destination (a 94- or 108-byte
    memory location), then reinitialize the FPU. FSAVE checks for
    unmasked FP error conditions before writing the state; FNSAVE does
    not make this check.

    The FPU state includes the environment (14 or 28 bytes) and the
    register stack, ST(0) thru ST(7) (80 bytes).
    The environment includes the control word, the status word, the tag
    word, and an error block (see FSTENV).


    FSAVE/FNSAVE are typically used when an operating system needs to
    perform a context switch, an exception handler needs to use the FPU,
    or an application program wants to 'clean' the FPU before a
    subroutine uses it.

    
    Note
    FSAVE/FNSAVE do not store the FPU state until all FPU activity has
    finished. To restore a saved state, use the FRSTOR instruction. If a
    program is to read from the state's memory image following a save
    instruction, it must issue an FWAIT instruction to ensure that the
    storage operation is complete.


    Opcode      Format
    9B DD /6    FSAVE m94byte   ; 16-bit code segment
    9B DD /6    FSAVE m108byte  ; 32-bit code segment
    DD /6       FNSAVE m94byte  ; 16-bit code segment
    DD /6       FNSAVE m108byte ; 32-bit code segment


    Timing
    Variations    8087         287        387      486     Pentium
    fsave      (197-207)+EA  197-207    375-376  154/143  127-151/124 NP
    fsavew                              375-376  154/143  127-151/124 NP
    fsaved                              375-376  154/143  127-151/124 NP
    fnsave     (197-207)+EA  197-207    375-376  154/143  127-151/124 NP
    fnsavew                             375-376  154/143  127-151/124 NP
    fnsaved                             375-376  154/143  127-151/124 NP

                Cycles for real mode/protected mode
                The wait version may take additional cycles

See Also: FSTENV FRSTOR FWAIT FINIT FPU registers CC

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson