95
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
11.6.4.1
ADR
Load PC-relative address.
Syntax
ADR{cond} Rd, label
where:
cond
is an optional condition code, see
.
Rd
is the destination register.
label
is a PC-relative expression. See
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 ADR is used to generate a target address for a BX or BLX instruction, ensure that bit[0] of the
address generated is set to 1 for correct execution.
Values of label must be within the range of
−
4095 to +4095 from the address in the PC.
Note:
The user might have to use the .W suffix to get the maximum offset range or to generate
addresses that are not word-aligned. See
.
Restrictions
Rd must not be SP and must not be PC.
Condition Flags
This instruction does not change the flags.
Examples
ADR
R1, TextMessage
; Write address value of a location labelled as
; TextMessage to R1
Summary of Contents for SAM4S Series
Page 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Page 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...