dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 603

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
RTSD
Operation:
X:(SP) → (stored SR; discarded)
SP – 1→ SP
SR[14:10],X:(SP) → PC
SP – 1→ SP
Execute instructions in next 3 delay slots
Description: Return from a call to a subroutine, but execute the instructions in the next 3 words of instruction before
Example:
Explanation of Example:
Restrictions:
Condition Codes Affected:
Freescale Semiconductor
SP
returning. To perform the return, RTSD pulls and discards the previously pushed 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 five bits of the (restored) PC.
OTHERCODE
The segment of code where the example 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 rou-
tine is invoked using a 3-word BSR instruction located at address $047549. The RTSD instruction
pulls the 16-bit PC and the stored SR from the software stack and updates the SP. The instructions in
the following 3 delay slots are then executed, and then program execution continues at $04754C (PC
bits 16–20 are obtained from bits 10–14 of the retrieved status register). In the example, the NOP in-
struction falls outside the 3-word delay slots, and therefore it is never executed.
Refer to Section 10.4, “Pipeline Dependencies and Interlocks,” on page 10-26.
Refer to Section 4.3.2, “Delayed Instruction Restrictions,” on page 4-14.
The condition codes are not affected by this instruction.
Before Execution
X:$0101
X:$0100
SR
RTSD
MOVE.W
MOVE.W
NOP
...
000101
Delayed Return from Subroutine
754C
1008
0004
A,X:$7000
B,X:$0010
Instruction Set Details
Assembler Syntax:
RTSD
; restore PC from the stack
; save A1, 2-word delay slot
; save B1, 1-word delay slot
; extra slot (not used)
SP
After Execution
X:$0101
X:$0100
SR
0000FF
754C
1008
1004
RTSD
A-259

Related parts for dsp56800e