JSR

JSR

Jump to Subroutine (AGU)

JSR

Operation

 

Assembler Syntax

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

→ SP; label → PC

JSR

label {0 label < 232,W}

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

→ SP; Rn → PC

JSR

Rn

Description

These operations jump to the subroutine location in program memory that is given by the instruction’s effective address. The operation includes an implicit push of the status register (SR) and the program counter (PC) onto the stack. The value of PC stored on the stack is that of the execution set following the current execution set. In addition, the value of the next PC is stored in the RAS shadow register. The destination address cannot be in the middle of an execution set.

JSR label

Jumps to a memory location specified by the label. The assembler and linker calculate the 32-bit absolute destination address from the label.

JSR 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

jsr r6

Register/Memory Address

R6

PC

SP

SR

($00000100)

($00000104)

Before

$0000 0012

$0000 0004

$0000 0100

$00E0 0000

After

$0000 0012

$00000108

$0000 000A

$00E0 0000

SC140 DSP Core Reference Manual

A-213

Page 527
Image 527
Freescale Semiconductor SC140 specifications Jump to Subroutine AGU, Jsr r6, JSR label, JSR Rn