13.07.2015 Views

Cortex-M0+ Devices Generic User Guide - Keil

Cortex-M0+ Devices Generic User Guide - Keil

Cortex-M0+ Devices Generic User Guide - Keil

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

The <strong>Cortex</strong>-<strong>M0+</strong> Instruction Set3.5.5 MOV and MVNMove and Move NOT.SyntaxMOV{S} Rd, RmMOVS Rd, #immMVNS Rd, Rmwhere:SRdRmIs an optional suffix. If S is specified, the condition code flags are updated on theresult of the operation, see Conditional execution on page 3-9.Is the destination register.Is a register.imm Is any value in the range 0-255.OperationThe MOV instruction copies the value of Rm into Rd.The MOVS instruction performs the same operation as the MOV instruction, but also updates the Nand Z flags.The MVNS instruction takes the value of Rm, performs a bitwise logical negate operation on thevalue, and places the result into Rd.RestrictionsIn these instructions, Rd, and Rm must only specify R0-R7.When Rd is the PC in a MOV instruction:• Bit[0] of the result is discarded.• A branch occurs to the address created by forcing bit[0] of the result to 0. The T-bitremains unmodified.NoteThough it is possible to use MOV as a branch instruction, ARM strongly recommends the use ofa BX or BLX instruction to branch for software portability.Condition flagsIf S is specified, these instructions:• update the N and Z flags according to the result• do not affect the C or V flags.ARM DUI 0662A Copyright © 2012 ARM. All rights reserved. 3-27ID041812Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!