English
Language : 

7220 Datasheet, PDF (31/303 Pages) Renesas Technology Corp – 8-BIT SINGLE-CHIP MICROCOMPUTER
FUNCTIONAL DESCRIPTION
2.1 Central processing unit
Storing of the processor status register in items  and ‘ above is not performed during a subroutine call.
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 (“0016” or “0116”).
• 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 (“0016” or “0116”).
• 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
(PCL).
• 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 incremented by 1.
‘ The contents at the address indicated as below are restored to high-order 8 bits of the program counter
(PCH).
• The high-order 8 bits are the stack area value (“0016” or “0116”).
• The low-order 8 bits are the stack pointer contents.
Restoring of the processor status register in items Œ and  above is not performed in this case. Execute
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 (“0016” or “0116”).
• The low-order 8 bits are the stack pointer.
2-4
7220 Group User’s Manual