title: How does the stack work in assembly language?
body: <p>I'm currently trying to understand how the stack works, so I've decided teach myself some <a href="http://en.wikipedia.org/wiki/Assembly_language" rel="noreferrer">assembly language</a>, I'm using this book:</p>
  
  <p><a href="http://savannah.nongnu.org/projects/pgubook/" rel="noreferrer">http://savannah.nongnu.org/projects/pgubook/</a> </p>
  
  <p>I'm using <a href="http://en.wikipedia.org/wiki/GNU_Assembler" rel="noreferrer">Gas</a> and doing my development on <a href="http://en.wikipedia.org/wiki/Linux_Mint" rel="noreferrer">Linux Mint</a>.</p>
  
  <p>I'm a bit confused by something:</p>
  
  <p>As far as I was aware a stack is simply a data structure. So I assumed if I was coding in assembly I'd have to implement the stack myself. However this doesn't seem to be the case as there are commands like</p>
  
  <pre><code>pushl
  popl
  </code></pre>
  
  <p>So when coding in assembly for the <a href="http://en.wikipedia.org/wiki/X86" rel="noreferrer">x86</a> architecture and using the Gas syntax: is the stack just a data structure that's already implemented? Or is it actually implemented at the hardware level? Or is it something else? Also would most assembly languages for other chip sets have the stack already implemented?</p>
  
  <p>I know this is a bit of a foolish question but I'm actually quite confused by this.</p>