Exchange Registers                              

86/88

Y

186

Y

286

Y

386

Y

486

Y

XCHG destination, source

Ovfl

N

Dir

N

Int

N

Trap

N

Sign

N

Zero

N

Aux

N

Prty

N

Carry

N

    XCHG switches the contents of its operands, which may be either bytes
    or words.

       Note:          Used in conjunction with the LOCK prefix, this
                      instruction is particularly useful when implementing
                      semaphores to control shared resources.

------------------------------------ Timing ----------------------------------

OpCode          Instruction             386     286     86
86/r            XCHG r/m8, r8           3/5     3/5     4/17+EA
86/r            XCHG r8, r/m8           3/5     3/5     4/17+EA
87/r            XCHG r/m16, r16         3/5     3/5     4/17+EA
87/r            XCHG r16, r/m16         3/5     3/5     4/17+EA
87/r            XCHG r/m32, r32         3/5
87/r            XCHG r32, r/m32         3/5
91+r            XCHG AX, r16            3       3       3
91+r            XCHG r16, AX            3       3       3
91+r            XCHG EAX, r32           3
91+r            XCHG r32, EAX           3

------------------------------------ Logic -----------------------------------

        destination <--> source

See Also MOV PUSH POP XLAT LOCK


Copyright © 1985 to 2022 Beta Systems                            Last modified: Wednesday, January 05, 2022 .