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.

System Instructions<br />

The operation. is one of ADC, ADD, AND, BIC, EOR, ORR, RSB, RSC, SBC, <strong>and</strong> SUB. Use of all<br />

of these operations except SUB is deprecated.<br />

The operation. is MOV or MVN. Use of MVN is deprecated.<br />

The first oper<strong>and</strong> register. Use of any register except LR is deprecated.<br />

The immediate constant. For encoding T1, is in the range 0-255. See Modified<br />

immediate constants in <strong>ARM</strong> instructions on page A5-9 for the range of available values in<br />

encoding A1.<br />

The optionally shifted second or only oper<strong>and</strong> register. Use of any register except LR is<br />

deprecated.<br />

The shift to apply to the value read from . If absent, no shift is applied. The shifts <strong>and</strong><br />

how they are encoded are described in Shifts applied to a register on page A8-10. Use of<br />

is deprecated.<br />

The value of the operation or is encoded in the opcode field of the instruction. For the opcode<br />

values for different operations see Operation on page B6-6.<br />

In Thumb code, MOVS PC,LR is a pseudo-instruction for SUBS PC,LR,#0.<br />

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

to S.<br />

Operation<br />

if ConditionPassed() then<br />

EncodingSpecificOperations();<br />

if CurrentInstrSet() == InstrSet_ThumbEE then<br />

UNPREDICTABLE;<br />

oper<strong>and</strong>2 = if register_form then Shift(R[m], shift_t, shift_n, APSR.C) else imm32;<br />

case opcode of<br />

when ‘0000’ result = R[n] AND oper<strong>and</strong>2; // AND<br />

when ‘0001’ result = R[n] EOR oper<strong>and</strong>2; // EOR<br />

when ‘0010’ (result, -, -) = AddWithCarry(R[n], NOT(oper<strong>and</strong>2), ‘1’); // SUB<br />

when ‘0011’ (result, -, -) = AddWithCarry(NOT(R[n]), oper<strong>and</strong>2, ‘1’); // RSB<br />

when ‘0100’ (result, -, -) = AddWithCarry(R[n], oper<strong>and</strong>2, ‘0’); // ADD<br />

when ‘0101’ (result, -, -) = AddWithCarry(R[n], oper<strong>and</strong>2, APSR.c); // ADC<br />

when ‘0110’ (result, -, -) = AddWithCarry(R[n], NOT(oper<strong>and</strong>2), APSR.C); // SBC<br />

when ‘0111’ (result, -, -) = AddWithCarry(NOT(R[n]), oper<strong>and</strong>2, APSR.C); // RSC<br />

when ‘1100’ result = R[n] OR oper<strong>and</strong>2; // ORR<br />

when ‘1101’ result = oper<strong>and</strong>2; // MOV<br />

when ‘1110’ result = R[n] AND NOT(oper<strong>and</strong>2); // BIC<br />

when ‘1111’ result = NOT(oper<strong>and</strong>2); // MVN<br />

CPSRWriteByInstr(SPSR[], ‘1111’, TRUE);<br />

BranchWritePC(result);<br />

Exceptions<br />

None.<br />

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

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

Saved successfully!

Ooh no, something went wrong!