28.06.2013 Views

ARM Software reference manual

ARM Software reference manual

ARM Software reference manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Instruction se!<br />

MOV<br />

causes the operand to be placed unchanged in the destination register,<br />

for example,<br />

MOV R0,R1,LSL#2<br />

MVN causes the operand to be evaluated and its bitwise inverse to be placed<br />

in the destination register. The contents of register 1 are shifted left by 2<br />

bits and transferred to register 0, for example,<br />

MVN R2,R3<br />

Register ORR 2 is set to the bitwise inverse of the contents of register 3.<br />

performs a bitwise OR on operand] and operand2. The result is stored<br />

in the destination register.<br />

RSB subtracts operand] from operand2. The result is stored in the<br />

destination register.<br />

RSC subtracts operandi from operand2 if the carry flag is set. If the carry<br />

flag is clear, operand2—operand1-1 is calculated. The result is stored in the<br />

destination register.<br />

sac subtracts operand2 from operandi if the carry flag is set. If the carry<br />

flag is clear, operandl—operand2-1 is calculated. The result is stored in the<br />

destination register. This instruction can be used to implement multi-word<br />

subtractions.<br />

sus subtracts operand2 from operand]. The result is stored in the<br />

destination register, for example:<br />

SUBS R4,R2,R0 ;Do least significant word<br />

;of subtraction<br />

SBC R5,R3,R1 ;Do most significant word,<br />

;taking account of the borrow<br />

;This does the 64 bit subtraction<br />

;(R5,R4)-(R3,R2)-(R1,R0)<br />

The result is stored in the destination register.<br />

TEQ performs a bitwise exclusive OR between operand] and operand2.<br />

TST performs a bitwise AND operation between operand] and operand2.<br />

In the case of TEQ and TST the N and V flags are altered according to the<br />

result, V is unchanged and C is set to the last bit shifted out by the barrel<br />

shifter, or is unchanged if no shifting took place.<br />

<strong>ARM</strong> software 11

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

Saved successfully!

Ooh no, something went wrong!