title: Assembly x86 - "leave" Instruction
body: <p>It's said that the "leave" instruction is similar to:</p>
  
  <pre><code>movl %ebp, %esp
  popl %ebp
  </code></pre>
  
  <p>I understand the <code>movl %ebp, %esp</code> part, and that it acts to release stored up memory (as discussed in <a href="https://stackoverflow.com/questions/5474355/about-leave-in-x86-assembly">this question</a>).</p>
  
  <p>But what is the purpose of the <code>popl %ebp</code> code?</p>