Stack Addressing - Renesas RL78/G1P Hardware User Manual

16-bit single-chip microcontroller
Hide thumbs Also See for RL78/G1P:
Table of Contents

Advertisement

RL78/G1P

3.4.9 Stack addressing

[Function]
The stack area is indirectly addressed with the stack pointer (SP) values. This addressing is automatically employed
when the PUSH, POP, subroutine call, and return instructions are executed or the register is saved/restored upon
generation of an interrupt request.
Only the internal RAM area can be set as the stack area.
[Description format]
Identifier
The data saved/restored by each stack operation is shown in Figures 3-32 to 3-37.
PUSH rp
<1>
Instruction code
OP-code
Stack addressing is specified <1>.
The higher-order and lower-order bytes of the pair of registers
indicated by rp <2> are stored in addresses SP  1 and SP  2,
respectively.
The value of SP <3> is decreased by two (if rp is the program
status word (PSW), the value of the PSW is stored in SP  1 and
0 is stored in SP  2).
R01UH0895EJ0100 Rev.1.00
Nov 29, 2019
PUSH PSW AX/BC/DE/HL
POP PSW AX/BC/DE/HL
CALL/CALLT
RET
BRK
RETB
(Interrupt request generated)
RETI
Figure 3-32. Example of PUSH rp
<2>
<1>
<2>
Description
SP
Higher-order byte of rp
SP1
<3>
SP 2
SP
rp
CHAPTER 3 CPU ARCHITECTURE
Stack area
Lower-order byte of rp
F0000H
Memory
60

Advertisement

Table of Contents
loading

Table of Contents