The instruction mov eax, eax
may be a no-operation code but that is not what you have here. You're loading from memory, as indicated by the []
"contents-of" characters.
It loads eax
with the contents of memory (a 32-bit dword
in this case) that is currently pointed to by eax
.
Perhaps a graphical picture would help:
Before:
eax: 0x12345678
memory @ 0x12345678: 0xffffffff
After:
eax: 0xffffffff
memory @ 0x12345678: 0xffffffff
As to possible uses, there are no doubt many. One that pops into mind immediately is a linked list structure where you have something like this for a single element in the list (pseudo-assembly):
next: word ? ; one word.
payload: byte ?(32) ; 32 bytes.
If eax
is used as a pointer to one of those elements, getting the next element would be done with the instruction you see:
mov eax, dword ptr [eax]