Chapter 2. Functional Description - Renesas 7200 Series User Manual

Mitsubishi 8-bit single-chip microcomputer
Table of Contents

Advertisement

FUNCTIONAL DESCRIPTION
2.1 Central processing unit
Storing of the processor status register in items
Execute the PHP instruction in a program to push the processor status register onto a stack.
To prevent data from losing during interrupts and subroutine calls, push the other registers onto a stack
by software as described above.
For example, execute the PHA instruction to push the accumulator contents onto a stack. Executing the
PHA instruction stores the accumulator contents 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 then decremented by 1.
Execute the RTI instruction to return from an interrupt routine.
When the RTI instruction is executed, the processing is performed automatically in the following sequence
(refer to "Figure 2.1.3").
The stack pointer contents are incremented by 1.
The contents at the address indicated as below are restored to the processor status register.
• 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 incremented by 1.
The contents at the address indicated as below are restored to low-order 8 bits of the program counter
(PC
).
L
• 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 incremented by 1.
The contents at the address indicated as below are restored to high-order 8 bits of the program counter
(PC
).
H
• The high-order 8 bits are the stack area value ("00
• The low-order 8 bits are the stack pointer contents.
Restoring of the processor status register in items
the RTS instruction to return from a subroutine.
Execute the PLP instruction and PLA instruction to restore the processor status register and the accumulator,
respectively.
Executing the PLP (PLA) instruction increments the stack pointer by 1 and restores the contents at the
address indicated as below to the processor status register.
• The high-order 8 bits are the stack area value ("00
• The low-order 8 bits are the stack pointer.
2-4
and
above is not performed during a subroutine call.
" or "01
16
" or "01
16
" or "01
16
" or "01
16
and
above is not performed in this case. Execute
" or "01
16
7220 Group User's Manual
").
16
").
16
").
16
").
16
").
16

Advertisement

Table of Contents
loading

This manual is also suitable for:

7220

Table of Contents