
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
638 of 808
NXP Semiconductors
UM10360
Chapter 34: Appendix: Cortex-M3 User Guide
2.4.5 LDR, PC-relative
Load register from memory.
2.4.5.1
Syntax
LDR{
type
}{
cond
}
Rt
,
label
LDRD{
cond
}
Rt
,
Rt2
,
label
; Load two words
type
is one of:
B
: unsigned byte, zero extend to 32 bits on loads.
SB
: signed byte, sign extend to 32 bits (
LDR
only).
H
: unsigned halfword, zero extend to 32 bits on loads.
SH
: signed halfword, sign extend to 32 bits (
LDR
only).
—: omit, for word.
cond
is an optional condition code, see
Section 34–2.3.7 “Conditional execution”
.
Rt
is the register to load or store.
Rt2
is the second register to load or store.
label
is a PC-relative expression. See
Section 34–2.3.6 “PC-relative expressions”
2.4.5.2
Operation
LDR
loads a register with a value from a PC-relative memory address. The memory
address is specified by a label or by an offset from the PC.
The value to load or store can be a byte, halfword, or word. For load instructions, bytes
and halfwords can either be signed or unsigned. See
label
must be within a limited range of the current instruction.
shows the
possible offsets between
label
and the PC.
Remark:
You might have to use the
.W
suffix to get the maximum offset range. See
Section 34–2.3.8 “Instruction width selection”
2.4.5.3
Restrictions
In these instructions:
•
Rt
can be SP or PC only for word loads
•
Rt2
must not be SP and must not be PC
•
Rt
must be different from
Rt2.
When
Rt
is PC in a word load instruction:
Table 590. Offset ranges
Instruction type
Offset range
Word, halfword, signed halfword, byte, signed byte
−
4095 to 4095
Two words
−
1020 to 1020