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

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

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

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

where:<br />

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

The destination register.<br />

Instruction Details<br />

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

+/- Is + or omitted to indicate that the immediate offset is added to the base register value<br />

(add == TRUE), or – to indicate that the offset is to be subtracted (add == FALSE). Different<br />

instructions are generated for #0 <strong>and</strong> #-0.<br />

The immediate offset used to form the address, Values are 0-4095 for encoding T1, <strong>and</strong><br />

0-255 for encoding T2 or A1. For the offset syntax, can be omitted, meaning an offset<br />

of 0.<br />

The pre-UAL syntax LDRSH is equivalent to LDRSH.<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,2];<br />

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

if UnalignedSupport() || address = ‘0’ then<br />

R[t] = SignExtend(data, 32);<br />

else // Can only apply before <strong>ARM</strong>v7<br />

R[t] = bits(32) UNKNOWN;<br />

Exceptions<br />

Data Abort.<br />

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

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

Saved successfully!

Ooh no, something went wrong!