If you're trying to exchange two values, the best way to do that is three XOR operations.
xorl %eax, %edx
xorl %ebx, %eax
xorl %eax, %edx
However, the thing to pay attention to is the list of legal operands:
src dst
idata reg
idata mem
reg reg
mem reg
reg mem
So I think what you'd have to do is move both pieces of data from the array to registers, XOR them, then move them back.
However, now that I put more thought into it, that might not answer your solution. I'll give it some more thought.
__________________
Eat antimatter, Posleen-boy!
|