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

Instruction Details<br />

ADD{S} {,} , # All encodings permitted<br />

ADDW {,} , # Only encoding T4 permitted<br />

where:<br />

S If S is present, the instruction updates the flags. Otherwise, the flags are not updated.<br />

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

The destination register.<br />

The first oper<strong>and</strong> register. If is SP, see ADD (SP plus immediate) on page A8-28. If <br />

is PC, see ADR on page A8-32.<br />

The immediate value to be added to the value obtained from . The range of values is 0-7<br />

for encoding T1, 0-255 for encoding T2 <strong>and</strong> 0-4095 for encoding T4. See Modified<br />

immediate constants in Thumb instructions on page A6-17 for the range of values for<br />

encoding T3.<br />

When multiple encodings of the same length are available for an instruction, encoding T3 is preferred to<br />

encoding T4 (if encoding T4 is required, use the ADDW syntax). Encoding T1 is preferred to encoding T2 if<br />

is specified <strong>and</strong> encoding T2 is preferred to encoding T1 if is omitted.<br />

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

Operation<br />

if ConditionPassed() then<br />

EncodingSpecificOperations();<br />

(result, carry, overflow) = AddWithCarry(R[n], imm32, ‘0’);<br />

R[d] = result;<br />

if setflags then<br />

APSR.N = result;<br />

APSR.Z = IsZeroBit(result);<br />

APSR.C = carry;<br />

APSR.V = overflow;<br />

Exceptions<br />

None.<br />

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

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

Saved successfully!

Ooh no, something went wrong!