MOV

From ARMwiki
(Difference between revisions)
Jump to: navigation, search
(Created.)
 
m (Changed "SBZ" in instruction encoding to be zeros.)
Line 49: Line 49:
 
| 1 1 0 1
 
| 1 1 0 1
 
| S
 
| S
| SBZ
+
| 0 0 0 0
 
| dest
 
| dest
 
| op/shift
 
| op/shift

Revision as of 06:30, 1 September 2011

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

Contents

MOV[S]

MOV will move 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 (MOVS), 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.

MOV is useful for transferring the contents of registers, setting registers prior to specific operations, perform a shift without requiring more complicated maths (LSL #x to multiply by 2x), update PC to return after a subroutine (the infamous MOV PC, LR).

Use MVN to place negative values into registers.

Syntax

  MOV<suffix>  <dest>, <op 1>

Function

  dest = op_1

Example

  MOV  R0, R0         ; equivalent to a NOP
  MOV  R0, R0, LSL#3  ; R0 = R0 * 8

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 0 1 S 0 0 0 0 dest op/shift
Personal tools
Namespaces

Variants
Actions
Navigation
Contents
Toolbox