T.I.M | ISA Specification
 All Pages
Stack Pointer

Address: 0001, Memonic: SP

Functionality:

Stores the address of the top element of the stack. This means that when loading from memory the value in the stack pointer, we get the top element. When pushing to the stack, the stackpointer is first decremented and we then store to that decremented address.

The initial value of the stack pointer after reset is undefined.

This register is 32 bits wide.

The contents are treated as 4-byte aligned unsigned memeory addresses.

Access

Can be read by:

  • MOVSR
  • PUSH
  • POP
  • TEST
  • RETURN

Can be written by:

  • MOVRS
  • POP
  • PUSH
  • JUMPI
  • JUMPR
  • CALLR
  • CALLI