Reputation:
as you can see in the picture, i can't understand the difference between DWORD PTR ds:0x402000 and ds:0x402000. what is the syntactical difference between them. both fetches 4 bytes from 0x402000 and store it in eax and ecx registers. but why the syntax is difference?
Upvotes: 0
Views: 708
Reputation: 364821
There's no difference. The load into EAX is using the short-form encoding, though.
I can't copy/paste anything from your crappy images of text, but notice in http://felixcloutier.com/x86/MOV.html that there's a special A1
opcode for loads into AX/EAX/RAX. For some reason objdump decides to omit the DWORD PTR
in that case.
DWORD operand size is already implied by the registers, so it's not needed.
(We can tell this is 32-bit code, not x86-64, because that opcode would use a 64-bit absolute address in long mode, unless there's an address-size prefix.)
Upvotes: 2