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>xchg exchange registers flags: not altered</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
XCHG            Exchange Registers                   Flags: Not altered

XCHG destination,source

        Logic   destination .. source

    XCHG switches the contents of two operands.

    If a memory operand is involved, BUS LOCK is asserted for the
    duration of the exchange, regardless of the presence or absence of
    the LOCK prefix or the value of the IOPL.


    Opcode      Format
    86 /r       XCHG r/m8,r8
    86 /r       XCHG r8,r/m8
    87 /r       XCHG r/m16,r16
    87 /r       XCHG r16,r/m16
    87 /r       XCHG r/m32,r32
    87 /r       XCHG r32,r/m32
    90 + rw     XCHG AX,r16
    90 + rw     XCHG r16,AX
    90 + rd     XCHG EAX,r32
    90 + rd     XCHG r32,EAX


    Length and timing
    Operands    Bytes   8088    186     286     386     486     Pentium
    reg, reg     2       4       4       3       3       3       3   NP
    reg, mem   2+d(0-2)  25+EA  17       5       5       5       3   NP
    mem, reg   2+d(0-2)  25+EA  17       5       5       5       3   NP
    acc, reg     1       3       3       3       3       3       2   NP
    reg, acc     1       3       3       3       3       3       2   NP

    (acc = AX or EAX only)

See Also: LOCK MOV PUSH ROL ROR CMPXCHG BSWAP

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