CMPXCHG8B       Compare and Exchange 8 Bytes         Flags: O D I T S Z A P C
- - - - - * - - -
CMPXCHG8B destination CPU: Pentium+

Logic if EDX:EAX = destination
ZF ← 1
destination ← ECX:EBX
else
ZF ← 0
EDX:EAX ← destination
endif

CMPXCHG8B compares the quadword in EDX:EAX with a 64-bit memory
operand. If they are equal, the quadword in the ECX:EBX register
pair is loaded into destination and the zero flag is set;
otherwise, the destination operand is loaded into the EDX:EAX
register pair and the zero flag is cleared.


Opcode Format
0F C7 /r CMPXCHG8B mem64


Length and timing
Operands Bytes 8088 186 286 386 486 Pentium
mem, reg 3+d(0-2) 10 NP