what does
lea (%edx,%eax,1),%eax
do?
It's the equivalent of "eax = edx + eax * 1".
This particular case of lea
is an inefficient way to write add %edx, %eax
; only useful if you need to avoid modifying flags. But unlike add
, the output can be a register that isn't one of the inputs, and you can do more complex operations.
Generally, lea (address expression), register
means "compute the address expression and change the register value to that"; other instructions use address expressions for memory access, i.e. mov (address expression), register
means "compute the address expression and load the value from the resulting address into the register".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With