4.6.1. B and BL

Branch, and Branch with Link.

Syntax

B{cond} label
BL{cond} label

where:

cond

is an optional condition code (see Conditional execution).

label

is a program-relative expression. See Register-relative and program-relative expressions for more information.

Usage

The B instruction causes a branchto 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

    B       loopA
    BLE     ng+8
    BL      subC
    BLLT    rtX
Copyright © 2000, 2001 ARM Limited. All rights reserved.ARM DUI 0068B
Non-Confidential