adr.w
Form PC-relative Address (Wide)
ADR.W <Rd>, <label>
Thumb-2 32-bit ADR.
Pseudocode Operation
offset ← expand_12bit_imm(i : imm3 : imm8)
Rd ← Align(PC, 4) + offset
Example
ADR.W r0, label
Encoding
Binary Layout
11110
31:27
i
26
10
25:24
0
23
0
22
0
21
0
20
1111
19:16
0
15
imm3
14:12
Rd
11:8
imm8
7:0
Operands
-
Rd
Destination general-purpose register -
label
Label
Related
More in T32 (Thumb2)
Reference
View in Arm A64 ISA Reference ↗
Arm AArch32 ISA
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x028F0000 | ADR{<c>}{<q>} <Rd>, <label> | A32 | cond | 0010 | 100 | 0 | 1111 | Rd | imm12 | ||
| 0x024F0000 | ADR{<c>}{<q>} <Rd>, <label> | A32 | cond | 0010 | 010 | 0 | 1111 | Rd | imm12 | ||
| 0xA000 | ADR{<c>}{<q>} <Rd>, <label> | T32 | 1010 | 0 | Rd | imm8 | ||
| 0xF2AF0000 | ADR{<c>}{<q>} <Rd>, <label> | T32 | 11110 | i | 10 | 1 | 0 | 1 | 0 | 1111 | 0 | imm3 | Rd | imm8 | ||
| 0xF20F0000 | ADR{<c>}.W <Rd>, <label> | T32 | 11110 | i | 10 | 0 | 0 | 0 | 0 | 1111 | 0 | imm3 | Rd | imm8 |
Description
Form PC-relative address adds an immediate value to the PC value to form a PC-relative address, and writes the result to the destination register.
Operation
if ConditionPassed() then
EncodingSpecificOperations();
result = if add then (Align(PC,4) + imm32) else (Align(PC,4) - imm32);
if d == 15 then // Can only occur for A32 encodings
ALUWritePC(result);
else
R[d] = result;