05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Instruction Details<br />

A8.6.59 LDR (literal)<br />

Load Register (literal) calculates an address from the PC value <strong>and</strong> an immediate offset, loads a word from<br />

memory, <strong>and</strong> writes it to a register. For information about memory accesses see Memory accesses on<br />

page A8-13.<br />

Encoding T1 <strong>ARM</strong>v4T, <strong>ARM</strong>v5T*, <strong>ARM</strong>v6*, <strong>ARM</strong>v7<br />

LDR ,<br />

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

0 1 0 0 1 Rt imm8<br />

t = UInt(Rt); imm32 = ZeroExtend(imm8:’00’, 32); add = TRUE;<br />

Encoding T2<br />

LDR.W ,<br />

<strong>ARM</strong>v6T2, <strong>ARM</strong>v7<br />

LDR.W ,[PC,#-0] Special case<br />

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

1 1 1 1 1 0 0 0 U 1 0 1 1 1 1 1 Rt imm12<br />

t = UInt(Rt); imm32 = ZeroExtend(imm12, 32); add = (U == ‘1’);<br />

if t == 15 && InITBlock() && !LastInITBlock() then UNPREDICTABLE;<br />

Encoding A1<br />

LDR ,<br />

<strong>ARM</strong>v4*, <strong>ARM</strong>v5T*, <strong>ARM</strong>v6*, <strong>ARM</strong>v7<br />

LDR ,[PC,#-0] Special case<br />

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

cond 0 1 0 (1) U 0 (0) 1 1 1 1 1 Rt imm12<br />

t = UInt(Rt); imm32 = ZeroExtend(imm12, 32); add = (U == ‘1’);<br />

Assembler syntax<br />

LDR , Normal form<br />

LDR , [PC, #+/-] Alternative form<br />

where:<br />

See St<strong>and</strong>ard assembler syntax fields on page A8-7.<br />

The destination register. The SP can be used. The PC can be used, provided the instruction<br />

is either outside an IT block or the last instruction of an IT block. If the PC is used, the<br />

instruction branches to the address (data) loaded to the PC. In <strong>ARM</strong>v5T <strong>and</strong> above, this<br />

branch is an interworking branch, see Pseudocode details of operations on <strong>ARM</strong> core<br />

registers on page A2-12.<br />

A8-122 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!