title: Why does DOS set the SP register to 0xFFFE after loading a .COM file?
body: <p>On the wikpedia page about .COM files <a href="https://en.wikipedia.org/wiki/COM_file" rel="noreferrer">https://en.wikipedia.org/wiki/COM_file</a> it reads:</p>
  
  <p><em>.COM files in DOS set all x86 segment registers to the same value and the SP (stack pointer) register to 0xFFFE, thus the stack begins at the very top of the memory segment and works down from there.</em></p>
  
  <p>But this actually sets the stack to begin one word below the top of the segment. When pushing a value on the stack the CPU will decrement SP to 0xFFFC and store the value there, thus wasting the top word of the segment. What is the reason for DOS not setting SP to 0 instead?</p>