ARM VERSION 1.2 Computer Hardware User Manual


 
ARM Instruction Reference
4-58 Copyright © 2000, 2001 ARM Limited. All rights reserved. ARM DUI 0068B
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 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
B loopA
BLE ng+8
BL subC
BLLT rtX