摘要 |
<p>Nested sub-program return addresses are managed by pushing successive sub-program return addresses onto a register stack (BP) as each layer of sub-program is called. A stack pointer register (ARP) is incremented or decremented (ID) each time an address is entered to, or removed from the stack (BP). On the completion of a sub-program the stack pointer, which has been left pointing to the top of the stack, i.e. to the last return address entered, quickly directs the program to the required return address which is extracted before the stack pointer is decremented by one. The stack thus operates on the 'last in-first out' principle. The stack shares an address counter (MPC) with the program memory (M) and its address register (MAR).</p> |