Datasheet

88
11011B–ATARM–21-Feb-12
SAM3N
10.12.1 ADR
Load PC-relative address.
10.12.1.1 Syntax
ADR{cond} Rd, label
where:
cond is an optional condition code, see “Conditional execution” on page 84.
Rd is the destination register.
label is a PC-relative expression. See “PC-relative expressions” on page 84.
10.12.1.2 Operation
ADR determines the address by adding an immediate value to the PC, and writes the result to
the destination register.
ADR produces position-independent code, because the address is PC-relative.
If you use ADR to generate a target address for a BX or BLX instruction, you must ensure that
bit[0] of the address you generate is set to1 for correct execution.
Values of label must be within the range of 4095 to +4095 from the address in the PC.
You might have to use the .W suffix to get the maximum offset range or to generate addresses
that are not word-aligned. See “Instruction width selection” on page 86.
10.12.1.3 Restrictions
Rd must not be SP and must not be PC.
10.12.1.4 Condition flags
This instruction does not change the flags.
10.12.1.5 Examples
ADR R1, TextMessage ; Write address value of a location labelled as
; TextMessage to R1