XADD Exchange and Add Flags: O D I T S Z A P C
* - - - * * * * *
XADD destination,source CPU: 486+
Logic XCHG destination,source
ADD destination,source
XADD loads destination into source, then adds destination and the
original source, returning the sum in destination.
Example: mov dl, 8
mov al, 3
xadd dl, al
; dl = 11, al = 8
Opcode Format
0F C0 /r XADD r/m8,r8
0F C1 /r XADD r/m16,r16
0F C1 /r XADD r/m32,r32
Length and timing
Operands Bytes 8088 186 286 386 486 Pentium
reg, reg 3 3 3 NP
mem, reg 3+d(0-2) 4 4 NP