The Stack


Because of the MC68000's autoincrementing and autodecrementing addressing modes, this CPU has effectively, eight stack pointers (A0-A7). The address register A7 is singular in the sense that when a return from a subroutine the return address is saved at the top of the stack pointed by A7.
The stack pointer in MC68000 always points to the last element placed in the stack and it grows to the bottom of the memory. Therefore, before each push in the stack the stack pointer is decremented and after each pop the stack pointer is incremented. The value of the increment or decrement depends on the instruction. For example, a MOVE.L (A7)+,D3 , which is a pop of the stack, will increment the stack pointer in 4 bytes, while the MOVE.W D3, -(A7), which is a  push to the stack, will decrement the stack pointer in 2 bytes. Figure 1 gives a graphical representation of the stack.
 



 



                                                                                                                               fig. 1