Home »
Embedded Systems
Data copy/ Transfer Instruction | Instruction set of 8086 Microprocessor
In this article, I have discussed about different instruction sets of 8086 microprocessor and will discuss the instruction Data copy/ transfer instruction briefly.
Submitted by Uma Dasgupta, on March 22, 2019
8086 instructions are divided into following types:
- Data copy/ Transfer Instruction
- Arithmetic and logical instruction
- Branch instruction
- Loop instruction
- Machine control instruction
- Flag manipulation instruction
- Shift and rotate instruction
- String instruction
Data copy/ Transfer Instruction
1) MOV- Move
Transfers data from 1 register/memory to another register/memory. Direct loading of segment register with immediate data is not permitted.
Example:
Mov Ax,Bx
Mov Ax,1000x
Mov Ds,1000H
Load 5000H
Load Ds with 5000H
Mov Ds,As
2) PUSH: Push to stack
This instruction pushes the content of specified register or memory location onto the stack. Stack pointer decremented by 2.
First- Higher byte
Second-Lower byte
3) POP: Pop from stack
This instruction when executed loads a specified register memory location with the contents of the memory location of which the address is formed using the current stack segment and stack pointer.
4) XCHG: Exchange
Exchanges the content of specified source and destination operand.
Note: Exchange of two memory location is not allowed.
5) IN: input code
This is used for reading an input code address of input code, may be specified either directly or indirectly.
AL (8 bit) & AX (16bit) are destination register.
Dx is the default register which is allowed to have implicit post register.
IN AL, O3H – reads data from 8bit port whose address is 03H.
6) OUT: Output to the port
It is used for writing output to the port. The address may be specified directly or indirectly data odd address is transfer from D18 – D15 even address code is transfer from D0-D7.
Example:
OUT 03H, AL
7) XLAT: Translate
The translate instruction is used for finding out the Codes in case of code conversion problem using lookup table technique.
8) LEA instruction (load effective balance)
It loads the effective address formed by destination operant into the specified source register.
LEA BX, ADR( offset of label ADR is transferred to reg- BX)
9) LDS/LES instruction: load pointer to DS/ES
It loads the Ds and Es register with the content of memory location specified as source in the instruction.
Example:
LDS DS, 5000H
10) LAHF: Load AH from lower byte of flag
Store AH to lower byte of the flag Register.
11) SAHF: Store AH to lower byte of flag register