Question for addressings like [ebp*2+edx+50]
Posted: Fri Jan 15, 2010 8:49 pm
Does something like [ebp*2+edx+50] gets calculated the same for the LEA instruction and for MOV or the rest of 32-bit instructions? From what the manuals say, it seems like that.
Also, how is that address calculated actually?
Does something like:
[ebp*2+edx+50]
Assuming that:
Default segment == always DS, except when the "base" register is EBP or ESP (in this case would be EDX)?
EBP = 3
EDX = 4
Would that be calculated like this?:
(3*2+4+50) == DS:60 -- (with cyclic 32-bit numbers if they overflow when added)
I have been trying to inspect the Bochs memory and seems that when EBP or ESP are the "base register" (e.g. if it instead was something like [ebp+edx*2+50] or [esp+edx*2+50]), the SS segment is used, LEA seems to work as described, and I'm fairly sure about everything else I have pointed out.
Is it correct?
Also, how is that address calculated actually?
Does something like:
[ebp*2+edx+50]
Assuming that:
Default segment == always DS, except when the "base" register is EBP or ESP (in this case would be EDX)?
EBP = 3
EDX = 4
Would that be calculated like this?:
(3*2+4+50) == DS:60 -- (with cyclic 32-bit numbers if they overflow when added)
I have been trying to inspect the Bochs memory and seems that when EBP or ESP are the "base register" (e.g. if it instead was something like [ebp+edx*2+50] or [esp+edx*2+50]), the SS segment is used, LEA seems to work as described, and I'm fairly sure about everything else I have pointed out.
Is it correct?