I am a bit confused by addressing modes.
array1 DWORD 200 DUP(?)
If i have this statement:
mov EAX, [EBX + EDI + 10]
EBX is the base, EDI is the index, and + 10 is saying add ten more bytes to EDI? so, EDI would then return 14 bytes long? and return the address and put it into EAX?
Similiarly,
mov EAX, [EBX + EDI * 4]
Is this saying that at what ever index in the array, returns 4 bytes long? Because the array is 4 bytes long for each index right? I guess im not understanding what * 4 does!
in addition,
mov ECX, 100 ; loop counter
mov ESI, 0
top1:
mov [array1 + ESI * 4], ECX
inc ESI
loop top1
This would be putting the number 100 into the array starting at index zero 4 bytes big? So, index[0] = 100, index[1]= 101, index[2]= 102?
Thank you
mov
like that doesn't put the address in the destination but the value at that address. If you want the address, that's whatlea
is for. – harold