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

Encoding

Binary Layout
0
31
immlo
30:29
10000
28:24
immhi
23:5
Rd
4:0
 
Format PC-rel
Opcode 0x10000000
Extension Base

Operands

  • Xd
    Destination 64-bit integer register
  • label
    Label

Related

Other forms of adr

  • adr Form PC-relative Address (Thumb)
  • adr Form PC-relative Address (A32)

More in Base

Reference

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;