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>fxch exchange register contents exceptions: i</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FXCH            Exchange register contents           Exceptions: I
                                                     C3 C2 C1 C0: ? ? 0 ?
FXCH [destination]

                ; FXCH          ; FXCH dest
        Logic   temp . ST(1)    temp . ST(i)
                ST(1) . ST      ST(i) . ST
                ST . temp       ST . temp

    FXCH swaps the contents of the destination and stack-top registers.
    If no destination is specified, ST is exchanged with ST(1).


    Note
    Many FPU instructions operate only on ST. FXCH provides a handy way
    to operate on lower stack elements.


        Example
        ; compute SQRT of ST(4)
        fxch ST(4)
        fsqrt
        fxch ST(4)


    Opcode      Format
    D9 C8 + i   FXCH ST(i)
    D9 C9       FXCH


    Timing
    Operand       8087         287        387      486     Pentium
    -            10-15        10-15       18        4      0-1     *

        * FCXH is pairable in the V pipe with all FX pairable instructions

See Also: FLD FILD CC

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