Intro to COA

# Data Transfer Instructions

Data transfer instructions basically include the instructions that are used to transfer data from one place to another (i.e., within the system or system to an I/O device).  These instructions are also known as copy instructions.

## Data Transfer Methods

The data movement cases are given below

• Memory to Register
• Register to Memory
• Register to Register

## Data Transfer Instructions Table

Let’s Understand the data transfer instructions table

## Types of Data Transfer Instructions

Some mostly using data transfer instructions are given below

• Symbolic (Mnemonics) of LOAD instruction is LD
• Example of a LOAD instruction is LD AX, BX

Explanation: Load from the source to the destination. As in the above example, AX is the Destination, and BX is the Source. Before the LOAD instruction execution, AX=3, and BX =5, and after the Execution of LOAD Instruction, AX= 5, BX=5.

### 2. STORE

• Symbolic (Mnemonics) of STORE instruction is ST
• Example of a LOAD instruction is ST AX, BX

Explanation: It means storing the value from the source and placing it in the destination. As in the above example, AX is the Destination, and BX is the Source. So,  After STORE instruction execution, AX=BX.

### 3. MOVE

• Symbolic (Mnemonics) of MOVE instruction is MOV
• Example of MOVE instruction is MOV AX, BX

Explanation: It means to move the value from the source and place it in the destination. AX is the destination, and BX is the source. So, After MOVE instruction execution, AX=BX.

### 4. MOVE IMMEDIATE

• Symbolic (Mnemonics) of MOVE IMMEDIATE instruction is MVI
• Example of MOVE IMMEDIATE instruction is MVI AX, BX

Explanation: MVI AX, BX means that BX will be copied to the register AX. If you want to take instant input from the user, then  MVI instruction is used. It is a two-byte instruction in which one byte contains an 8-bit op-code, and the other byte contains an 8-bit operand (Data) and two machine cycles with seven T series.

### 5. EXCHANGE

• Symbolic (Mnemonics) of EXCHANGE instruction is XCH
• Example of EXCHANGE instruction is XCH AX, BX

Explanation: Exchange Interchange the value of source and destination in the above example. If AX=3, BX =5, then after exchange execution, AX= 5, BX=3.

### 6. INPUT

• Symbolic (Mnemonics) of INPUT instruction is INPUT
• Example of INPUT instruction is INPUT AX, BX

Explanation: The content of the input port is read and loaded into the Accumulator Register through an 8bit Bus. In the above diagram, A word is read from the 00FFH address port to the AX register.

### 7. OUTPUT

• Symbolic (Mnemonics) of OUTPUT instruction is OUT
• An example of OUTPUT instruction is OUT AX, 00FFH

Explanation: This instruction shows the result of the AX register in the above example.

### 8. PUSH

• Symbolic (Mnemonics) of PUSH instruction is PUSH
• An example of PUSH instruction is PUSH a

Explanation: It means Push data to stack Memory.

### 8. POP

• Symbolic (Mnemonics) of POP instruction is POP
• An example of POP instruction is POP a

Explanation: It means POP data from stack Memory.

Note: All above Instructions do not affect the flag register; carry register, sign, and parity flag.