<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cheatengine.org/index.php?action=history&amp;feed=atom&amp;title=Assembler%3ACommands%3AXCHG</id>
	<title>Assembler:Commands:XCHG - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cheatengine.org/index.php?action=history&amp;feed=atom&amp;title=Assembler%3ACommands%3AXCHG"/>
	<link rel="alternate" type="text/html" href="https://wiki.cheatengine.org/index.php?title=Assembler:Commands:XCHG&amp;action=history"/>
	<updated>2026-06-28T05:53:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>https://wiki.cheatengine.org/index.php?title=Assembler:Commands:XCHG&amp;diff=5756&amp;oldid=prev</id>
		<title>OldCheatEngineUser: Created page with 'Category:Assembler '''command''' xchg ''destination, source''  Exchange the contents of the source with the destination.   &lt;div style=&quot;padding:2px;border:1px dashed #2f6fab;b…'</title>
		<link rel="alternate" type="text/html" href="https://wiki.cheatengine.org/index.php?title=Assembler:Commands:XCHG&amp;diff=5756&amp;oldid=prev"/>
		<updated>2018-02-04T00:27:49Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;&lt;a href=&quot;/index.php?title=Category:Assembler&quot; title=&quot;Category:Assembler&quot;&gt;Category:Assembler&lt;/a&gt; &amp;#039;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;#039; xchg &amp;#039;&amp;#039;destination, source&amp;#039;&amp;#039;  Exchange the contents of the source with the destination.   &amp;lt;div style=&amp;quot;padding:2px;border:1px dashed #2f6fab;b…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Assembler]]&lt;br /&gt;
'''command''' xchg ''destination, source''&lt;br /&gt;
&lt;br /&gt;
Exchange the contents of the source with the destination.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:2px;border:1px dashed #2f6fab;background-color:#f4f4f4;&amp;quot;&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
[https://c9x.me/x86/html/file_module_x86_id_328.html c9x.me/x86/html/file_module_x86_id_328.html]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Command Parameters ===&lt;br /&gt;
{|width=&amp;quot;85%&amp;quot; cellpadding=&amp;quot;10%&amp;quot; cellpadding=&amp;quot;5%&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
!align=&amp;quot;left&amp;quot;|Parameter&lt;br /&gt;
!style=&amp;quot;width: 80%;background-color:white;&amp;quot; align=&amp;quot;left&amp;quot;|Description&lt;br /&gt;
|-&lt;br /&gt;
|destination&lt;br /&gt;
|r8-m8 / r16-m16 / r32-m32&lt;br /&gt;
|-&lt;br /&gt;
|source&lt;br /&gt;
|r8-m8 / r16-m16 / r32-m32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
 xchg dl,ah&lt;br /&gt;
&lt;br /&gt;
 xchg al,[edx+110] // byte value&lt;br /&gt;
&lt;br /&gt;
 xchg ax,dx&lt;br /&gt;
&lt;br /&gt;
 xchg [eax+10],dx // word value&lt;br /&gt;
&lt;br /&gt;
 xchg edx,eax&lt;br /&gt;
&lt;br /&gt;
 xchg [esi],edi // dword value&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{AssemblerCommandSeeAlso}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [https://c9x.me/x86/ c9x.me/x86/]&lt;br /&gt;
* [http://ref.x86asm.net/ ref.x86asm.net]&lt;br /&gt;
* [https://wikipedia.org/wiki/X86_instruction_listings wikipedia.org/wiki/X86_instruction_listings]&lt;/div&gt;</summary>
		<author><name>OldCheatEngineUser</name></author>
		
	</entry>
</feed>