cmpxchg8b

Compare and Exchange 8 Bytes

CMPXCHG8B m64

Atomically compares EDX:EAX with memory; swaps if equal.

Details

The Compare and Exchange 8 Bytes instruction atomically compares EDX:EAX with memory; swaps if equal.

Pseudocode Operation

// Atomically compares EDX:EAX with memory; swaps if equal

Example

CMPXCHG8B [rbp-8]

Encoding

Binary Layout
0F
+0
C7
+1
ModRM
+2
 
Format Legacy
Opcode 0F C7 /1
Extension Base

Operands

  • dest
    64-bit memory operand (quadword)