C8051F39x/37x
SFRPGCN
SFRPGEN
Interrupt
Logic
000
001
010
011
100
SFRPAGE
SFR Page
Stack
SFRSTACK
Figure 19.1. SFR Page Stack
Upon an interrupt, hardware performs the five following operations:
1. The value (if any) in the SFRPGIDX = 011b location is pushed to the SFRPAGE = 100b location.
2. The value (if any) in the SFRPGIDX = 010b location is pushed to the SFRPAGE = 011b location.
3. The value (if any) in the SFRPGIDX = 001b location is pushed to the SFRPAGE = 010b location.
4. The current SFRPAGE value is pushed to the SFRPGIDX = 001b location in the stack.
5. SFRPAGE is set to the page corresponding to the flag which generated the interrupt.
On a return from interrupt, hardware performs the four following operations:
1. The SFR page stack is popped resulting in the value in the SFRPGIDX = 001b location returning to the
SFRPAGE register, thereby restoring the SFR page context without software intervention.
2. The value in the SFRPGIDX = 010b location of the stack is placed in the SFRPGIDX = 001b location.
3. The value in the SFRPGIDX = 011b location of the stack is placed in the SFRPGIDX = 010b location.
4. The value in the SFRPGIDX = 100b location of the stack is placed in the SFRPGIDX = 011b location.
Automatic switching of the SFR page by hardware upon interrupt entries and exits may be enabled or dis-
abled using the SFR Automatic Page Control Enable Bit (SFRPGEN) located in SFRPGCN. The automatic
SFR page switching is enabled after a reset until disabled by firmware.
100
Preliminary Rev. 0.71