MOV Instruction


The instruction moves the integer -5000h to the register. The first operand () is called the destination operand, and the second operand is called the source operand.
MOV Instruction Output

 INCLUDE Irvine32.inc
 .data
  X  SDWORD  -5000h
 .code
 main PROC
  mov   eax, X
  call  WriteHex
  exit
 main ENDP
 END main



 

MOV — Move Byte or Word
Usage: MOV dest, src

Flag O D I S Z A P C
Result                

Copies byte or word from the source operand to the destination operand.

Clocks
Operands 286 386 486 Size Bytes
reg, reg 2 2 1 2
mem, reg 3 2 1 2-4
reg, mem 5 4 1 2-4
mem, immed 3 2 1 3-6
reg, immed 2 2 1 2-3
mem, accum 3 2 1 3
...


is very flexible in its use of operands, as long as the following rules are observed:

  • Both operands can not be memory operands. For the example, move the value of to the value of :
  • Both operands must be the same size.
  • , , and registers can not be destination operands.
  • An immediate value can not be moved to a segment register.
INCLUDE Irvine32.inc
.data
  X   SDWORD  -5000h
  Y   SDWORD  ?
.code
main PROC
  mov   eax, X
  mov   Y, eax
  mov   eax, Y
  call  WriteHex
  exit
main ENDP
END main




      “My grandmother started walking five miles a day    
      when she was sixty. She’s ninety-seven now,    
      and we don’t know where the heck she is.    
      — Ellen DeGeneres