title: How to check if the stack is empty on 8086
body: <p>I am working on a study in Assembler 8086 that checks the balance of the parenthesis in a mathematical expression. The algorithm is as follows:</p>
  
  <ul>
  <li>Make an empty stack</li>
  <li>Read characters until end of string</li>
  <li>If the character is an opening symbol, push it onto stack</li>
  <li>If it is a closing symbol, then if the stack is empty report an error, otherwise, pop the stack</li>
  <li>If the symbol popped is not the corresponding opening symbol, then report an error</li>
  <li>At end of file, if the stack is not empty report an error</li>
  </ul>
  
  <p>I have figured out all the parts except the part that I need to check if the stack is empty. How can I check if the stack is empty or how can I create an empty stack in the code? When there is nothing left to pop in the stack, I try to pop it and some value comes out. What does that value mean?</p>