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

AND{S} {,} , {,}<br />

where:<br />

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

The register that is optionally shifted <strong>and</strong> used as the second oper<strong>and</strong>.<br />

The shift to apply to the value read from . If present, encoding T1 is not permitted. If<br />

absent, no shift is applied <strong>and</strong> all encodings are permitted. Shifts applied to a register on<br />

page A8-10 describes the shifts <strong>and</strong> how they are encoded.<br />

In Thumb assembly:<br />

outside an IT block, if ANDS ,, has <strong>and</strong> both in the range R0-R7, it is assembled<br />

using encoding T1 as though ANDS , had been written<br />

inside an IT block, if AND ,, has <strong>and</strong> both in the range R0-R7, it is<br />

assembled using encoding T1 as though AND , had been written.<br />

To prevent either of these happening, use the .W qualifier.<br />

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

Operation<br />

if ConditionPassed() then<br />

EncodingSpecificOperations();<br />

(shifted, carry) = Shift_C(R[m], shift_t, shift_n, APSR.C);<br />

result = R[n] AND shifted;<br />

if d == 15 then // Can only occur for <strong>ARM</strong> encoding<br />

ALUWritePC(result); // setflags is always FALSE here<br />

else<br />

R[d] = result;<br />

if setflags then<br />

APSR.N = result;<br />

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

APSR.C = carry;<br />

// APSR.V unchanged<br />

Exceptions<br />

None.<br />

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

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

Saved successfully!

Ooh no, something went wrong!