Hi I'm new to assembly currently coding in 32bit assembly and I'm trying to access an array I initialized.
This is the array
lookup: dd 0, 3, 6, 9, 2, 5, 8, 1, 4, 7
This is what I'm trying to accomplish
add bh, [lookup+al*4]
al is the index I want to add to bh
The code in c would be
b += a[i];
(b is bh, array is lookup, and al is i)
Any advice on how to accomplish this would be awesome, thanks!
al*4isn't valid when specifying an address. Useeax*4instead (and make sure that the unused bits ofeaxare zeroed).