2

What does leal (%eax, %eax) do? Does that multiply the contents at %eax * 2 since it has parens?

Carl Norum
  • 219,201
  • 40
  • 422
  • 469
fvertk
  • 159
  • 1
  • 12
  • Isn't there an operand missing? – Gunther Piez Sep 24 '12 at 09:52
  • Right hirschhomsalz, that's not how it's commonly called, so most examples don't cover this use of it, only the three operand version. So I'm not sure if you're the one that gave me a -1, but I think it's a legit question if you yourself didn't realize that it works this way (because I didn't). – fvertk Sep 24 '12 at 22:57

1 Answers1

4

It will load the destination operand with the sum of eax and eax, IOW, 2*eax.

Alexey Frunze
  • 61,140
  • 12
  • 83
  • 180
  • Thanks! For some reason this was hard for me to find this specific use of it, so hopefully this will help those who also face this in the future. – fvertk Sep 24 '12 at 22:56