Rts - Hitachi SH7750 Programming Manual

High-performance risc engine superh (sh) 32-bit risc mcu/mpu series
Hide thumbs Also See for SH7750:
Table of Contents

Advertisement

10.80

RTS

Return from Subroutine Procedure
Format
RTS
Description
This instruction returns from a subroutine procedure by restoring the PC from PR. Processing
continues from the address indicated by the restored PC value. This instruction can be used to
return from a subroutine procedure called by a BSR or JSR instruction to the source of the call.
Notes
As this is a delayed branch instruction, the instruction following this instruction is executed before
the branch destination instruction.
Interrupts are not accepted between this instruction and the following instruction. If the following
instruction is a branch instruction, it is identified as a slot illegal instruction.
The instruction that restores PR must be executed before the RTS instruction. This restore
instruction cannot be in the RTS delay slot.
Operation
RTS( ) /* RTS */
{
unsigned int temp;
temp=PC;
PC=PR;
Delay_Slot(temp+2);
}
ReTurn from Subroutine
Summary of Operation
PR → PC
Branch Instruction
Delayed Branch Instruction
Instruction Code
0000000000001011 2
Rev. 2.0, 03/99, page 351 of 396
Execution
States
T Bit

Advertisement

Table of Contents
loading

Table of Contents