![[HTML 2.0 Checked!]](valid.gif)
![[image]](line.gif)
As mentioned earlier, the a7 address register is made up of two stacks each of which have a register called the stack pointer, which holds the address of the top of the stack. The stack is neccessary if the flow of a program is changed by an interupt or a subroutine call. Essential information to continue the running of the program is store on the stack i.e. the program counter and the status register. To add to the stack an item is pushed and to take from it an item is popped and all actions take place relative to the stack pointer.
![[image]](init.gif)
The original stack position.
![[image]](push.gif)
The result of a push on the stack
![[image]](pop.gif)
The result of a pop on the stack
The two stack pointers are;![[back]](back1.gif)
![[contents]](cont.gif)