|
|||||||||||
Technical Support On-Line Manuals Assembler User Guide ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
ADR (PC-relative)
10.11 ADR (PC-relative)Generate a PC-relative address in the destination register, for a label in the current area. Syntax
where:
UsageADR produces position-independent
code, because the assembler generates an instruction that adds or
subtracts a value to the PC.Use the
ADRL pseudo-instruction
to assemble a wider range of effective addresses.label must evaluate to
an address in the same assembler area as the ADR instruction.If you use
ADR to generate a target
for a BX or BLX instruction,
it is your responsibility to set the Thumb bit (bit 0) of the address
if the target contains Thumb instructions.Offset range and architecturesThe assembler calculates the offset from the PC for you. The assembler
generates an error if
is out of range.The following table shows the possible offsets between the label and the
current instruction:
Notes about the Architectures columnEntries in the Architectures column indicate that the instructions are
available as follows:
ADR in ThumbYou can use the
.W width specifier to force ADR to
generate a 32-bit instruction in Thumb code. ADR with .W always
generates a 32-bit instruction, even if the address can be generated
in a 16-bit instruction.For forward references,
ADR without .W always
generates a 16-bit instruction in Thumb code, even if that results
in failure for an address that could be generated in a 32-bit Thumb ADD instruction.RestrictionsIn Thumb code,
R cannot be PC or SP .In ARM code,
R can be PC or SP but
use of SP is deprecated in ARMv6T2 and above.Related conceptsRelated referencea
Rd must be in the range R0-R7.
b
Must be a multiple of 4.
| ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.