ARM Instruction Reference

4.9.3LDR ARM pseudo-instruction

Load a register with either:

a 32-bit constant value

an address.

Note

This section describes the LDR pseudo-instruction only. See ARM memory access instructions on page 4-6 for information on the LDR instruction.

Syntax

LDR{cond} register,=[expr label-expr]

where:

 

 

cond

is an optional condition code.

register

is the register to be loaded.

expr

evaluates to a numeric constant:

 

the assembler generates a MOV or MVN instruction, if the value of expr

 

 

is within range

 

if the value of expr is not within range of a MOV or MVN instruction,

 

 

the assembler places the constant in a literal pool and generates a

 

 

program-relative LDR instruction that reads the constant from the

 

 

literal pool.

label-expr

is a program-relative or external expression. The assembler places the

 

value of label-exprin a literal pool and generates a program-relative LDR

 

instruction that loads the value from the literal pool.

If label-expris an external expression, or is not contained in the current section, the assembler places a linker relocation directive in the object file. The linker generates the address at link time.

4-82

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

ARM DUI 0068B

Page 192
Image 192
ARM VERSION 1.2 manual LDR ARM pseudo-instruction