title: MIPS: relevant use for a stack pointer ($sp) and the stack
body: <p>Currently I'm studying for my computer organization midterm, and I'm trying to fully understand the stack pointer and the stack. I know these following facts that surround the concept:</p>
  
  <ul>
  <li>It follows the first in last out principle</li>
  <li><p>And adding something to the stack takes a two step process:</p>
  
  <pre><code>addi $sp, $sp, -4
  sw $s0, 0($sp)
  </code></pre></li>
  </ul>
  
  <p>What I think is stopping me from fully understanding is that I can't come up with a relevant, self apparent situation where I would need and/or want to keep track of data with a stack pointer.</p>
  
  <p>Could someone elaborate on the concept as a whole and give me some useful code examples?</p>