If I say:
lea (%eax,%eax,2), %edx
I've been taught that it essentially means:
edx = eax + eax * 2
How does the format to this work?
And I guess this leads into the second question. If I have something like this:
add -0x4(%esi, %ebx, 4), %eax
I understand that the first operand is added to the second operand and then stored in the second operand, but again, what I don't understand is the first operand's notation. Another example would be if I had:
cmp %eax, (%esi, %ebx, 4)
..., does this mean that the value at %eax is being compared with the value of:
esi + ebx * 4
...? I tried searching a lot of this stuff but I guess I wasn't using the correct words to find a meaningful answer so I decided to post here.