title: lea assembly instruction
body: <p>I Just want to make sure I am reading this right:</p>
  
  <pre><code>movl 12(%ebp), %edx
  leal (%edx, %edx, 4), %eax
  </code></pre>
  
  <p>I read the first line as: <code>edx = [epb + 12]</code>, and the second line as: <code>eax = edx + edx*4</code></p>
  
  <p>Can anybody clarify?</p>
  
  <p>Also, what if I had the following two lines:</p>
  
  <pre><code>leal (%edx, %edx, 4), %eax
  leal (%edx, %edx, 2), %eax
  </code></pre>
  
  <p>Once the second line is executed, would the <code>eax</code> register be overwritten?</p>
  
  <p>And the <code>eax = edx + edx*4</code> is multiplying the address by 4? Or the contents of the address by 4?</p>