xadd

486 and later

Exchange and Add

xadd r/m8, reg8 | xadd r/m16, reg16 | xadd r/m32, reg32 | xadd r/m64, reg64

XADD exchanges the values in its two operands, and then adds them together and writes the result into the destination (first) operand. This instruction can be used with a LOCK prefix for multi-processor synchronisation purposes.

Loading...

Forms

Every form of xadd the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
xadd r/m8, reg8486lock
xadd r/m16, reg16486lock
xadd r/m32, reg32486lock
xadd r/m64, reg64x86-64locklong