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

LDRH , [, {, LSL #}] Offset: index==TRUE, wback==FALSE<br />

LDRH , [, +/-] Offset: index==TRUE, wback==FALSE<br />

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

LDRH , [], +/- 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. The PC can be used only in the <strong>ARM</strong> instruction set.<br />

+/- Is + or omitted if the optionally shifted value of is to be added to the base register value<br />

(add == TRUE), or – if it is to be subtracted (permitted in <strong>ARM</strong> code only, add == FALSE).<br />

Contains the offset that is optionally left shifted <strong>and</strong> added to the value of to form the<br />

address.<br />

If present, the size of the left shift to apply to the value from , in the range 1-3. Only<br />

encoding T2 is permitted, <strong>and</strong> is encoded in imm2.<br />

If absent, no shift is specified <strong>and</strong> all encodings are permitted. In encoding T2, imm2 is<br />

encoded as 0b00.<br />

The pre-UAL syntax LDRH is equivalent to LDRH.<br />

Operation<br />

if ConditionPassed() then<br />

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

offset = Shift(R[m], shift_t, shift_n, APSR.C);<br />

offset_addr = if add then (R[n] + offset) else (R[n] - offset);<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] = ZeroExtend(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-157

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

Saved successfully!

Ooh no, something went wrong!