Fig. 2.1.2 Cpu Mode Register - Renesas 7200 Series User Manual

Mitsubishi 8-bit single-chip microcomputer
Table of Contents

Advertisement

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 00FB
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 "00
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

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 (PC
below:
• The high-order 8 bits are the stack area value ("00
• 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 (PC
below:
• The high-order 8 bits are the stack area value ("00
• 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 ("00
• The low-order 8 bits are the stack pointer contents.
The stack pointer contents are decremented by 1.
1
1
1
0
0
CPU mode register (CPUM) (CM) [Address 00FB
B
Fix these bits to "0."
0, 1
Stack page selection
2
bit (CM2)
3
Fix these bits to "1."
to
5
6, 7
Note: This bit is set to "1" after reset release.
7220 Group User's Manual
FUNCTIONAL DESCRIPTION
Name
Functions
0: 0 page
1: 1 page
) are stored at an address indicated as
H
" or "01
16
16
) are stored at an address indicated as
L
" or "01
16
16
" or "01
16
16
2.1 Central processing unit
" (stack address is 0100
16
]
16
After reset
0
(Note)
1
1
Indeterminate
").
").
").
). At
16
), the stack
16
R W
R W
R W
R W
R W
2-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

7220

Table of Contents