MVN

From ARMwiki
(Difference between revisions)
Jump to: navigation, search
(Changed "SBZ" in instruction encoding to be zeros.)
(Added more descriptive title.)
Line 2: Line 2:
 
| opcode = MVN
 
| opcode = MVN
 
| suffix = [S]
 
| suffix = [S]
| function = Move-not data into register
+
| function = Move-negative data into register
 
| category = Data processing
 
| category = Data processing
 
| family = All
 
| family = All
Line 8: Line 8:
 
}}
 
}}
  
==MVN[S]==
+
==MVN[S] : Move Negative==
 
MVN will move the complement of the specified data into the specified register.
 
MVN will move the complement of the specified data into the specified register.
  

Revision as of 07:04, 22 December 2011

MVN
Instruction MVN[S]
Function Move-negative data into register
Category Data processing
ARM family All
Notes -

Contents

MVN[S] : Move Negative

MVN will move the complement of the specified data into the specified register.

Operand 1 may be another register, a shifted register, or an immediate value (which may be shifted).

If the S bit is set (MVNS), the N and Z flags are set according to the value moved (after shifting, if shifter used), and the C flag is set by the shifter.

MVN is useful for determining the complement of a value, and it is also a simple way to specify negative values (i.e. a SWI call wants -1 as a parameter).

Syntax

  MVN<suffix>  <dest>, <op 1>

Function

  dest = (NOT op_1)

Example

  MVN  R0, #1         ; sets R0 to -1

Technical

The instruction bit pattern is as follows:

31 - 28 27 26 25 24 - 21 20 19 - 16 15 - 12 11 - 0
condition 0 0 I 1 1 1 1 S 0 0 0 0 dest op/shift
Personal tools
Namespaces

Variants
Actions
Navigation
Contents
Toolbox