1 adr thumb pseudo-instruction – ARM VERSION 1.2 User Manual

Page 234

Advertising
background image

Thumb Instruction Reference

5-40

Copyright © 2000, 2001 ARM Limited. All rights reserved.

ARM DUI 0068B

5.6.1

ADR Thumb pseudo-instruction

The

ADR

pseudo-instruction loads a program-relative address into a register.

Syntax

ADR register, expr

where:

register

is the register to load.

expr

is a program-relative expression. The offset must be positive and less than
1KB.

expr

must be defined locally, it cannot be imported.

Usage

In Thumb state,

ADR

can generate word-aligned addresses only. Use the

ALIGN

directive

to ensure that

expr

is aligned (see ALIGN on page 7-50).

expr

must evaluate to an address in the same code section as the

ADR

pseudo-instruction.

There is no guarantee that the address will be within range after linking if it resides in
another ELF section.

Example

ADR r4,txampl ; => ADD r4,pc,#nn
; code
ALIGN
txampl DCW 0,0,0,0

Advertising