Generate a PC-relative address in the destination register, for a label in the current area.
is an optional condition code.
is an optional instruction width specifier.
is the destination register to load.
is a PC-relative expression.
labelmust be within a limited distance of the current instruction.
ADR produces position-independent
code, because the assembler generates an instruction that adds or
subtracts a value to the PC.
to assemble a wider range of effective addresses.
label must evaluate to
an address in the same assembler area as the
If you use
ADR to generate a target for
it is your responsibility to set the T32 bit (bit 0) of the address if the target contains
Offset range and architectures
The 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:
ADR in T32
You can use the
.W width specifier to
ADR to generate a 32-bit instruction in T32 code.
generates a 32-bit instruction, even if the address can be generated in a 16-bit
For forward references,
.W always generates a 16-bit instruction in T32 code,
even if that results in failure for an address that could be generated in a 32-bit T32
In T32 code,
R cannot be
In A32 code,
R can be
SP but use of
Must be a multiple of 4.