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.

Assembler syntax<br />

LDR , [ {, #+/-}] Offset: index==TRUE, wback==FALSE<br />

LDR , [, #+/-]! Pre-indexed: index==TRUE, wback==TRUE<br />

LDR , [], #+/- Post-indexed: index==FALSE, wback==TRUE<br />

where:<br />

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

Instruction Details<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 />

The base register. The SP can be used. For PC use see LDR (literal) on page A8-122.<br />

+/- Is + or omitted if the immediate offset is to be added to the base register value (add == TRUE),<br />

or – if it is to be subtracted (add == FALSE). #0 <strong>and</strong> #-0 generate different instructions.<br />

The immediate offset used to form the address. For the offset addressing syntax, can<br />

be omitted, meaning an offset of 0. Values are:<br />

Encoding T1 multiples of 4 in the range 0-124<br />

Encoding T2 multiples of 4 in the range 0-1020<br />

Encoding T3 any value in the range 0-4095<br />

Encoding T4 any value in the range 0-255.<br />

Operation<br />

if ConditionPassed() then<br />

EncodingSpecificOperations(); NullCheckIfThumbEE(n);<br />

offset_addr = if add then (R[n] + imm32) else (R[n] - imm32);<br />

address = if index then offset_addr else R[n];<br />

data = MemU[address,4];<br />

if wback then R[n] = offset_addr;<br />

if t == 15 then<br />

if address == ‘00’ then LoadWritePC(data); else UNPREDICTABLE;<br />

elsif UnalignedSupport() || address = ‘00’ then<br />

R[t] = data;<br />

else R[t] = bits(32) UNKNOWN; // Can only apply before <strong>ARM</strong>v7<br />

Exceptions<br />

Data Abort.<br />

ThumbEE instruction<br />

ThumbEE has additional LDR (immediate) encodings. For details see LDR (immediate) on page A9-19.<br />

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

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

Saved successfully!

Ooh no, something went wrong!