dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 602

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
RTS
Operation:
X:(SP) → (stored SR; discarded)
SP – 1→ SP
SR[14:10],X:(SP) → PC
SP – 1→ SP
Description: Return from a call to a subroutine. To perform the return, RTS pulls and discards the previously pushed
Example:
Explanation of Example:
Restrictions:
Condition Codes Affected:
Instruction Fields:
Instruction Opcodes:
Timing:
Memory:
A-258
RTS
Operation
RTS
SP
SR (except bits 10–14) and pops the PC from the software stack. The previous PC is lost. The SR is
not affected except for bits 10–14, which contain the upper 5 bits of the (restored) PC.
RTS
The segment of code where the example instruction resides is located within the lower 64K words of
program memory. The segment shown is the returning portion of the routine. The example assumes
that the routine is invoked using a 3-word BSR instruction located at address $047549. The RTS in-
struction pulls the 16-bit PC and bits 10–14 of the stored SR from the software stack and updates the
SP. Program execution continues at $04754C (PC bits 16–20 are obtained from bits 10–14 of the re-
trieved status register).
Refer to Section 10.4, “Pipeline Dependencies and Interlocks,” on page 10-26.
The condition codes are not affected by this instruction.
8 oscillator clock cycles
1 program word
Before Execution
X:$0101
X:$0100
Operands
SR
; pull and discard the SR from the stack (except bits 10–14),
; pull the PC from the stack
000101
754C
1008
0009
DSP56800E Core Reference Manual
Return from Subroutine
C
8
15
1
W
1
1
Return from subroutine, restoring 21-bit PC from the stack
1
RTS
Assembler Syntax:
12
0
11
0
1
SP
After Execution
X:$0101
X:$0100
1
1
8
SR
Comments
7
0
0000FF
0
754C
1008
1009
Freescale Semiconductor
0
0
4
1
3
0
RTS
0
0
0

Related parts for dsp56800e