IP2022 Users ManualInstruction Set Architecture
www.ubicom.com
81
When a subroutine is called, the return address is pushed onto the
subroutine stack, as shown in Figure 3-12. Specifically, each
saved address in the stack is moved to the next lower level to
make room for the new address to be saved. Stack 1 receives the
contents of the program counter. Stack 16 is overwritten with what
was in Stack 15. The contents of stack 16 are lost.
Figure 3-12 Stack Operation on Subroutine Call
515-010.eps
Stack 1
Stack 2
Program Counter (15:0)
Stack 16 Contents
are Discarded
Stack 3
Stack 4
Stack 5
Stack 6
Stack 7
Stack 8
Stack 9
Stack 10
Stack 11
Stack 12
Stack 13
Stack 14
Stack 15
Stack 16