Return Pointer (Rp) - Fujitsu FR Family Instruction Manual

32-bit microcontroller
Hide thumbs Also See for FR Family:
Table of Contents

Advertisement

3.3.4

Return Pointer (RP)

The return pointer (RP) is a register used to contain the program counter (PC) value
during execution of call instructions, in order to assure return to the correct address
after the call instruction has executed.
■ Overview of the Return Pointer
The contents of the return pointer (RP) depend on the type of instruction. For a call instruction with a delay
slot, the value is the address stored +4, and for a call instruction with no delay slot, the value is the address
stored +2. The save data is returned from the "RP" pointer to the "PC" counter by execution of a "RET"
instruction.
Figure 3.3-9 shows a sample operation of the "RP" pointer in the execution of a "CALL" instruction with
no delay slot, and Figure 3.3-10 shows a sample operation of the "RP" pointer in the execution of a "RET"
instruction.
Figure 3.3-9 Sample Operation of "RP" in Execution of a "CALL" Instruction with No Delay Slot
Before execution
PC
12345678
RP
????????
Figure 3.3-10 Sample Operation of "RP" in Execution of a "RET" Instruction
Before execution
PC
SUB1
RP
1234567A
Memory space
CALL SUB1
H
H
SUB1
RET
Memory space
CALL SUB1
ADD #1,R00
H
SUB1
RET
CHAPTER 3 REGISTER DESCRIPTIONS
After execution
PC
SUB1
RP
1234567A
H
SUB1
After execution
PC
1234567A
H
RP
1234567A
H
SUB1
Memory space
CALL SUB1
RET
Memory space
CALL:D SUB
ADD #1,R00
RET
25

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fr series

Table of Contents