Data Transfer Instructions



 MOV Des, Src:

  • Src operand can be register, memory location or immediate operand.
  • Des can be register or memory operand.
  • Both Src and Des cannot be memory location at the same time.

E.g.:
MOV CX, 037A H
MOV AL, BL
MOV BX, [0301 H]



 PUSH Operand:

  • It pushes the operand into top of stack.


E.g.: PUSH BX

 POP Des:

  • It pops the operand from top of stack to Des.
  • Des can be a general purpose register, segment register (except CS) or memory location.


E.g.: POP AX


 XCHG Des, Src:

  • This instruction exchanges Src with Des.
  • It cannot exchange two memory locations directly.

E.g.: XCHG DX, AX


 IN Accumulator, Port Address:

  • It transfers the operand from specified port to accumulator register.

E.g.: IN AX, 0028 H

 OUT Port Address, Accumulator:

  • It transfers the operand from accumulator to specified port.

E.g.: OUT 0028 H, AX




 LEA Register, Src:

  • It loads a 16-bit register with the offset address of the data specified by the Src.
  • This instruction loads the contents of DI (offset) into the BX register.


E.g.: LEA BX, [DI]


 LDS Des, Src:

  • It loads 32-bit pointer from memory source to destination register and DS.
  • The offset is placed in the destination register and the segment is placed in DS.
  • To use this instruction the word at the lower memory address must contain the offset and the word at the higher address must contain the segment.

E.g.: LDS BX, [0301 H]


 LES Des, Src:

  • It loads 32-bit pointer from memory source to destination register and ES.
  • The offset is placed in the destination register and the segment is placed in ES.
  • This instruction is very similar to LDS except that it initializes ES instead of DS.

E.g.: LES BX, [0301 H]


 LAHF:

  • It copies the lower byte of flag register to AH.

 SAHF:

  • It copies the contents of AH to lower byte of flag register.

 PUSHF:

  • Pushes flag register to top of stack.

 POPF:

  • Pops the stack top to flag register.