adr
Form PC-relative Address
ADR <Xd>, <label>
Calculates the address of a label (PC +/- 1MB range).
Pseudocode Operation
Xd ← PC + SignExtend(immhi:immlo, 21)
Example
ADR x0, label
Reference
View in Arm A64 ISA Reference ↗
Arm A64 ISA
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x10000000 | ADR <Xd>, <label> | A64 | 0 | immlo | 10000 | immhi | Rd | ||
| 0x04A0A000 | ADR <Zd>.<T>, [<Zn>.<T>, <Zm>.<T>{, <mod> <amount>}] | A64 | 00000100 | 1 | sz | 1 | Zm | 1010 | msz | Zn | Zd | ||
| 0x0420A000 | ADR <Zd>.D, [<Zn>.D, <Zm>.D, SXTW{ <amount>}] | A64 | 00000100 | 0 | 0 | 1 | Zm | 1010 | msz | Zn | Zd | ||
| 0x0460A000 | ADR <Zd>.D, [<Zn>.D, <Zm>.D, UXTW{ <amount>}] | A64 | 00000100 | 0 | 1 | 1 | Zm | 1010 | msz | Zn | Zd |
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
X[d, 64] = PC64 + imm;