JSRD

JSRD Jump to a Subroutine Using a Delay Slot (AGU) JSRD

Operation

Assembler Syntax

(Next* PC) → (SP); SR → (SP + 4); SP + 8 → SP;

JSRD label {0 label < 232,W}

(Next* PC) →RAS; label → PC

 

(Next* PC) → (SP); SR → (SP + 4); SP + 8 → SP;

JSRD Rn

(Next* PC) → RAS; Rn → PC

 

Description

Executes the execution set in the delay slot, then pushes the next* PC (the PC of the execution set after the delay slot) and SR onto the stack, and causes program execution to continue at the address defined by label or Rn. In addition, the next* PC is stored in the RAS register, and RAS becomes valid. The destination address cannot be in the middle of an execution set.

JSRD label

Jumps to a memory location specified by an immediate 32-bit absolute address.

JSRD Rn

Jumps to a memory location contained in an address register (Rn). The value in Rn must be word-aligned.

Status and Conditions that Affect Instruction

Register Address

Bit Name

Description

SR[18]

EXP

Determines which stack pointer is used.

Status and Conditions Changed by Instruction

None.

Example jsrd r6

Instruction

Comment

move.w #subroutine,r6

Places subroutine label in r6.

move.w #$35,d0

Places $35 in d0.

jsrd r6 move.w #$29,d1

Jump to subroutine, place $29 in d1.

inc d1

Increment executed in the delay slot, d1=$2A.

- - - -

Skipped over.

- - - -

Skipped over.

- - - -

Skipped over.

subroutine

Execution continues here at subroutine.

move.w #$16,d4

 

SC140 DSP Core Reference Manual

A-215

Page 529
Image 529
Freescale Semiconductor SC140 specifications Example jsrd r6, Next* PC → RAS Rn → PC, Jsrd label, Jsrd Rn