I am trying to get a good grip on the LEA instruction in x86:
leal (%edx, %edx, 4), %eax
leal (%edx, %edx, 2), %eax
Given these two lines, i know that:
eax = edx + edx*4
and then
eax = edx + edx*2
Two questions. First, if these instructions appear in sequence as in this example, the eax register is overwritten once the second line executes? And what exactly would be loaded into the register? Another address? Or is this doing arithmetic on the values that these registers point to?