title: Assembly language - can LEA instruction be used to load value
body: <p>I am new to assembly language. I am currently going through this <a href="http://www.cs.virginia.edu/~evans/cs216/guides/x86.html" rel="nofollow noreferrer">Assembly Guide</a>. I have doubt in LEA instruction. My understanding of <code>LEA</code> instruction is <code>LEA</code> loads the <strong>destination operand</strong> with the effective address of <strong>source operand</strong> </p>
  
  <p>Below example is from the same link.</p>
  
  <pre><code>lea edi, [ebx+4*esi] — the quantity EBX+4*ESI is placed in EDI.
  lea eax, [var] — the value in var is placed in EAX.
  lea eax, [val] — the value val is placed in EAX.
  </code></pre>
  
  <p>In the above 2nd and 3rd example comment says the value is loaded in the EAX. This is my confusion. Kindly let me know if LEA instruction can be used to load the effective address as well as value in the destination operand.</p>
  
  <p><a href="https://i.stack.imgur.com/4I3jv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4I3jv.png" alt="Introduction to assembly language"></a></p>
  
  <hr>
  
  <p>The above image is from <a href="https://www.youtube.com/playlist?list=PL038BE01D3BAEFDB0" rel="nofollow noreferrer">Introduction to assembly language</a> from youtube's Open SecurityTraining channel.</p>
  
  <p>Thank You.</p>