xchg

Exchange Register/Memory with Register

XCHG r/m, r

Exchanges content of two operands.

Details

The Exchange Register/Memory with Register instruction exchanges content of two operands.

Pseudocode Operation

temp <- DEST
DEST <- SRC
SRC <- temp

Example

XCHG rbx, rax

Encoding

Binary Layout
87
+0
 
Format Legacy
Opcode 87
Extension Base

Operands

  • dest
    Register or memory operand
  • src
    General-purpose register