The 2nd usage of the mov instruction
 

  • The mov instruction can also be used to:

    • Move (= copy) the 32 bit (binary) number from one register into another register

  • The syntax of this mov instruction is:

          mov rN, rM      // rN = rM, i.e.: copy rM to rN
                          // Copies all 32 bits           
      
       E.g.:
      
          mov r0, r1      // r0 = r1, i.e.: copy r1 to r0
      

    Note:

    • The entire register rM is copied into the register rN.

Example: copying data from one register into another register
 

Examples:

 mov  r0, r1      // Copies r1 into r0 (Assigns: r0 = r1;)

 mov  r3, r5      // Copies r5 into r3 (Assigns: r3 = r5;)  

 

Example of the result of executing the instruction mov r0, r1:

How the computer executes the mov r0,r1 instruction
 

Suppose the next instruction executed is   mov r0, r1:

The mov r0, r1 instruction is first fetched into the Instruction Register (IR) during the Instruction Fetch step

How the computer executes the mov r0,r1 instruction
 

Then the mov r0, r1 will be executed by steps 2,3,4 of the Instruction Execution Cylce:

The mov r0, r1 will store the value in R1 into register R0