0
votes

I know that this line of code moves somthing into the eax register, but what does dword ptr [edx +15Ch] do ?

mov eax, dword ptr [edx + 15Ch]

does it take the value in edx and add 15C = Q , then load the value in address Q into eax? if so, what does the dword ptr mean in this conetxt?

1
Yes it does that. dword ptr is just a size specification but the size is obvious from the eax target anyway. - Jester
so, dword specifies the size, and ptr specifies that Q is an address pointing to some memory location? is that info useful for the CPU? - vincentleest
dword ptr is just a syntactical element, some assemblers use just dword others use size suffix. The cpu only sees the machine code, these things just help the assembler to pick the right instruction when it is ambiguous. In this case eax already specifies the size. - Jester
Another dword memory access that need to specify the size: mov dword ptr[edx+15Ch], 1 - Dirk Wolfgang Glomp

1 Answers

2
votes

Yes, that's exactly what it does.

The dword ptr modifier is redundant here because the register is already 32 bits, but it is sometimes necessary to tell the assembler what type of data it should be working on when it can't be directly inferred. For example

push dword ptr [edx + 15Ch]