<<< More MOV Instruction Types | Index | The XCHG Examples >>> |
The XCHG (exchange data) instruction exchanges the contents of two operands.
There are three variants:
XCHG reg, reg XCHG reg, mem XCHG mem, reg
You can exchange data between registers or between registers and memory, but not from memory to memory:
xchg ax, bx ; Put AX in BX and BX in AX xchg memory, ax ; Put "memory" in AX and AX in "memory" xchg mem1, mem2 ; Illegal, can't exchange memory locations!
The rules for operands in the XCHG instruction are the same as those for the MOV instruction...
...except that XCHG does not accept immediate operands.
<<< More MOV Instruction Types | Index | The XCHG Examples >>> |