Stack

Stack is the data structure that you can and should use in your programs. To do this, you must:

  1. Reserve not too small block of the memory (not necessarily initialized)
  2. Set SR register to the address of its begin

Data can be pushed onto top of the stack (they are written, the stack register is incremented) and popped from the top of the stack (stack register is decremented and data are read). Stack is used by the stack instructions and several execution instructions: PUSH, POP, CALL, RET etc.