English
Language : 

7220 Datasheet, PDF (30/303 Pages) Renesas Technology Corp – 8-BIT SINGLE-CHIP MICROCOMPUTER
FUNCTIONAL DESCRIPTION
2.1 Central processing unit
2.1.3 Stack pointer (S)
The stack pointer is an 8-bit register used for interrupts and subroutine calls.
The stack area can be assigned into the internal RAM.
The internal RAM of M37221M6-XXXSP/FP is assigned in the zero page and the page 1. The both area
can use for the stack area. The stack area is specified with the CPU mode register (address 00FB16). At
reset, the stack area is specified to the page 1 automatically.
Note: Storing data in the stack area fills the RAM area with stored data in order, therefore make sure the
depth of interrupt levels and the subroutine nesting.
The stack area and stack pointer (S) should be specified in the initialization of software. When the stack
area is specified to “1,” even if the value of stack pointer is over “0016” (stack address is 010016), the stack
area value never change to “0” automatically. Therefore in this case, change the stack area value by
software.
CPU Mode Register
b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 1 0 0 CPU mode register (CPUM) (CM) [Address 00FB16]
B
Name
0, 1 Fix these bits to “0.”
Functions
2 Stack page selection 0: 0 page
bit (CM2)
1: 1 page
(Note)
3 Fix these bits to “1.”
to
5
6, 7
Note: This bit is set to “1” after reset release.
After reset R W
0
RW
1
RW
1
RW
Indeterminate R W
Fig. 2.1.2 CPU mode register
With the stack pointer during a interrupt or subroutine call, the processing is performed automatically in the
following sequence (refer to “Figure 2.1.3”).
ΠThe contents of high-order 8 bits of the program counter (PCH) are stored at an address indicated as
below:
• The high-order 8 bits are the stack area value (“0016” or “0116”).
• The low-order 8 bits are the stack pointer contents.
 The stack pointer contents are decremented by 1.
Ž The contents of low-order 8 bits of the program counter (PCL) are stored at an address indicated as
below:
• The high-order 8 bits are the stack area value (“0016” or “0116”).
• The low-order 8 bits are the stack pointer contents.
 The stack pointer contents are decremented by 1.
 The contents of the processor status register (PS) are stored at an address indicated as below:
• The high-order 8 bits are the stack area value (“0016” or “0116”).
• The low-order 8 bits are the stack pointer contents.
‘ The stack pointer contents are decremented by 1.
7220 Group User’s Manual
2-3