Reputation: 31
with this data
.data
tableD DWORD 10h, 20h, 30h, 40h, 50h, 60h
Rowsize = ($ - tableD)
DWORD 60h,70h,80h,90h,0A0h
DWORD 0B0h,0C0h,0D0h,0E0h,0F0h
I can use
.code
mov eax,tableD[ebx + esi*TYPE tableD]
but I can't use
mov eax,tableD[ebx*2 + esi*TYPE tableD]
but I can use
mov eax,tableD[ebx*2 + esi]
can't I use 2 *s in there?
can I know the terms for those objects?
Upvotes: 3
Views: 167
Reputation: 93172
The x86 architecture supports a four-part addressing mode of the following form:
base + index * scale + displacement
where all four parts can be absent (scale
is 1
if absent). This means that there can be only one scaled component in a memory operand; so yes, you can only use one *
.
Furthermore, scaling factors are limited to 1, 2, 4, or 8; other scaling factors cannot be encoded.
Upvotes: 6