BSR

BSR

Branch to Subroutine (AGU)

Operation

 

Assembler Syntax

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

BSR

<label

PC + displacement → PC; (Next PC)→ RAS

BSR

>label

BSR

Description

BSR <label

BSR >label

Pushes the next PC and SR onto the stack and causes program execution to continue at location PC + displacement. The displacement, calculated by the assembler and linker, is a two’s complement integer that represents the relative distance from the current PC to the destination label. The assembler determines if the PC relative displacement is a short branch (<label [–28≤ displacement < 28, W]) or a long branch (>label [–220≤ displacement < –28, W and 28 ≤ displacement < 220, W]). In addition to being pushed onto the stack, the next PC is stored in the return address from subroutine register (RAS) and RAS becomes valid.

Status and Conditions that Affect Instruction

Register Address

Bit Name

Description

SR[18]

EXP

Determines the stack pointer used in instructions that have a stack

 

 

pointer as an operand.

Status and Conditions Changed by Instruction

None.

Example

bsr _label

Register/Memory Address

SR

_label (displacement)

PC

NSP

($30)

($34)

Before

$00E0 0000

$0000 0014

$0000 0002

$30

After

$0000 0016

$38

$0000 0006

$00E0 0000

SC140 DSP Core Reference Manual

A-105

Page 419
Image 419
Freescale Semiconductor SC140 Bsr, Branch to Subroutine AGU, Status and Conditions Changed by Instruction None Example