ARM Instruction Reference

4.6.1B and BL

Branch, and Branch with Link.

Syntax

B{cond} label BL{cond} label where:

cond

is an optional condition code (see Conditional execution on page 4-4).

label

is a program-relative expression. See Register-relative and

 

program-relative expressions on page 3-23 for more information.

Usage

The B instruction causes a branch to label.

The BL instruction copies the address of the next instruction into r14 (lr, the link register), and causes a branch to label.

Machine-level B and BL instructions have a range of ±32Mb from the address of the current instruction. However, you can use these instructions even if label is out of range. Often you do not know where label is placed by the linker. When necessary, the ARM linker adds code to allow longer branches (see The ARM linker chapter in ADS Linker and Utilities Guide). The added code is called a veneer.

Architectures

These instructions are available in all versions of the ARM architecture.

Examples

BloopA

BLE

ng+8

BL

subC

BLLT

rtX

4-58

Copyright © 2000, 2001 ARM Limited. All rights reserved.

ARM DUI 0068B

Page 168
Image 168
ARM VERSION 1.2 manual Branch, and Branch with Link, Syntax