Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 1: PIC16F887 Microcontroller - Device Overview
Table 1-5 SFR Bank 2
Table 1-6 SFR Bank 3
STACK
A part of the RAM used for the stack consists of eight 13-bit registers. Before the microcontroller starts to execute a
subroutine (CALL instruction) or when an interrupt occurs, the address of first next instruction being currently executed is
pushed onto the stack, i.e. onto one of its registers. In that way, upon subroutine or interrupt execution, the
microcontroller knows from where to continue regular program execution. This address is cleared upon return to the main
program because there is no need to save it any longer, and one location of the stack is automatically available for further
use.
It is important to understand that data is always circularly pushed onto the stack. It means that after the stack has been
http://www.mikroe.com/en/books/picmcubook/ch1/ (13 of 14)5/3/2009 11:31:25 AM