5.6.1. ADR Thumb pseudo-instruction

The ADR pseudo-instruction loads a program-relative or register-relative address into a register.

Syntax

The syntax of ADR is:

ADR register, expression

where:

register

is the register to load.

expression

is a register-relative or program-relative expressionthat evaluates to a word-aligned address within the range +4 to +1020 bytes. expression must be defined locally, it cannot be imported.

Refer to ^ or MAP directive for more information on register-relative expressions.

Usage

In Thumb state, ADR can generate word-aligned addresses only. Use the ALIGN directive to ensure that expression is aligned.

If expression is program-relative, it must evaluate to an address in the same code area as the ADR pseudo-instruction. There is no guarantee that the address will be within range after linking if it resides in another AOF area.

Example

		ADR		r4,txampl				; => ADD r4,pc,#nn
		; code
		ALIGN
txampl		DCW		0,0,0,0
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0041C
Non-Confidential