Jsrd, Jump to a subroutine using a delay slot (agu), Description – Freescale Semiconductor StarCore SC140 User Manual

Page 529: Example, Operation assembler syntax

Advertising
background image

JSRD

SC140 DSP Core Reference Manual

A-215

JSRD

Jump to a Subroutine Using a Delay Slot (AGU)

JSRD

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.

Status and Conditions that Affect Instruction

Status and Conditions Changed by Instruction

None.

Example

jsrd r6

Operation

Assembler Syntax

(Next* PC)

→ (SP); SR → (SP + 4); SP + 8 → SP;

(Next* PC)

→RAS; label → PC

JSRD label {0

≤ label < 2

32

,W}

(Next* PC)

→ (SP); SR → (SP + 4); SP + 8 → SP;

(Next* PC)

→ RAS; Rn → PC

JSRD Rn

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.

Register Address

Bit Name

Description

SR[18]

EXP

Determines which stack pointer is used.

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

Advertising