Assembler:Commands:XCHG

From Cheat Engine

Jump to: navigation, search

command xchg destination, source

Exchange the contents of the source with the destination.


Exchanges the contents of the destination (first) and source (second) operands. The operands can be two general-purpose registers or a register and a memory location. If a memory operand is referenced, the processor's locking protocol is automatically implemented for the duration of the exchange operation, regardless of the presence or absence of the LOCK prefix or of the value of the IOPL. The XCHG instruction can also be used instead of the BSWAP instruction for 16-bit operands.

c9x.me/x86/html/file_module_x86_id_328.html


Contents

[edit] Command Parameters

Parameter Description
destination r8-m8 / r16-m16 / r32-m32
source r8-m8 / r16-m16 / r32-m32


[edit] Examples

xchg dl,ah
xchg al,[edx+110] // byte value
xchg ax,dx
xchg [eax+10],dx // word value
xchg edx,eax
xchg [esi],edi // dword value


[edit] See also

[edit] External links

Personal tools
Toolbox