Search code examples
assemblyx86swapno-op

What does xchg eax, eax do? Is it a NOP?


What is the effect of:

xchgl %eax, %eax

xchg is for swapping data, but if src and dst are the same, then it has basically no effect?


Solution

  • xchg eax, eax, or in binary the one-byte instruction 0x90, is also known as nop. It does nothing.