views:

91

answers:

2

Hi guys,

let's assume I've got the address of my array (passed as a pointer to the function) in esi register. How can I access a particular cell of the array? i.e:

my_array[a + b * c]

where c is constant.

Thank you for the fast reply!

Cheers

+1  A: 

Look up instructions such as LEA.

Think of it this way:

LEA edx,[esi+ebx*4]
Daniel Goldberg
A: 

you could directly move it as follows also:

MOV EDX,ESI[4*BX]

am not sure but i think it should work

ruchir patwa