m37905 Renesas Electronics Corporation., m37905 Datasheet - Page 27

no-image

m37905

Manufacturer Part Number
m37905
Description
Mitsubishi 16-bit Single-chip Microcomputer 7700 Family / 7900 Series
Manufacturer
Renesas Electronics Corporation.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
m37905F8CSP
Manufacturer:
MIT
Quantity:
20 000
CENTRAL PROCESSING UNIT (CPU)
2.1 Central processing unit (CPU)
2-4
2.1.4 Stack pointer (S)
The stack pointer (S) is a 16-bit register. It is used for a subroutine call or an interrupt. It is also used when
addressing modes using the stack are executed. The contents of S indicate an address (stack area) for
storing registers during subroutine calls and interrupts. Bank 016 is specified for the stack area. (Refer to
section “2.3 Access space.”)
When an interrupt request is accepted, the microcomputer stores the contents of the program bank register
(PG) at the address indicated by the contents of S and decrements the contents of S by 1. Then the
contents of the program counter (PC) and the processor status register (PS) are stored. The contents of
S after accepting an interrupt request is equal to the contents of S decremented by 5 before accepting of
the interrupt request. (See Figure 2.1.2.)
When completing the process in the interrupt routine
and returning to the original routine, the contents of
registers stored in the stack area are restored into
the original registers in the reverse sequence
(PS PC PG) by executing the RTI instruction. The
contents of S is returned to the state before accepting
an interrupt request.
The same operation is performed during a subroutine
call, however, the contents of PS is not automatically
stored. (The contents of PG may not be stored.
This depends on the addressing mode.)
During interrupts or subroutine calls, the other
registers are not automatically stored. Therefore, if
the contents of these registers need to be held on,
be sure to store them by software.
Additionally, the S’s contents become “0FFF
reset. The stack area changes when subroutines
are nested or when multiple interrupt requests are
accepted. Therefore, make sure of the subroutine’s
nesting depth not to destroy the necessary data.
Refer to “7900 Series Software Manual” for addressing modes and instructions.
7905 Group User’s Manual Rev.1.0
16
” at
Fig. 2.1.2 Contents of stack area after accepting
A d d r e s s
S – 5
S – 4
S – 3
S – 2
S – 1
S
interrupt request
“ S ” i s t h e i n i t i a l a d d r e s s t h a t t h e s t a c k p o i n t e r ( S )
i n d i c a t e s a t a c c e p t i n g a n i n t e r r u p t r e q u e s t .
T h e S ’ s c o n t e n t s b e c o m e “ S – 5 ” a f t e r s t o r i n g t h e
a b o v e r e g i s t e r s .
Processor status register’s high-order byte (PS
P r o c e s s o r s t a t u s r e g i s t e r ’ s l o w - o r d e r b y t e ( P S
Program counter’s high-order byte (PC
Program counter’s low-order byte (PC
Program bank register (PG)
S t a c k a r e a
L
H
)
)
L
H
)
)

Related parts for m37905