Does it exchange %eax
and value stored at address%ecxx
and store the sum in address%ecx
?
The instruction XADD
...
...Exchanges the first operand (destination operand) with the second operand (source operand), then loads the sum of the two values into the destination operand.
So, according to its Operation, it executes the following microcode:
TEMP ← SRC + DEST;
SRC ← DEST;
DEST ← TEMP;
In your case this means that xadd %eax, (%ecx)
EAX
plus the value at the address pointed to by ECX
ECX
to EAX
ECX
This instruction can be combined with a LOCK
prefix and hence be executed atomically.