INSTRUCTION SET OF 8086
The Instruction set of 8086 microprocessor is classified into 7, they are:-·
Data Transfer instructions
Data transfer instruction, as the name suggests is for the transfer of data from memory to internal register, from internal register to memory, from one register to another register, from input port to internal register, from internal register to output port etc
1. MOV instruction
It is a general purpose instruction to transfer byte or word from register to register, memory to register, register to memory or with immediate addressing.
General Form:
MOV destination, source
Here the source and destination needs to be of the same size, that is both 8 bit or both 16 bit.
MOV instruction does not affect any flags.
Example:-
MOV BX, 00F2H ; load the immediate number 00F2H in BX register
MOV CL, [2000H] ; Copy the 8 bit content of the memory location, at a displacement of 2000H from data segment base to the CL register
MOV [589H], BX ; Copy the 16 bit content of BX register on to the memory location, which at a displacement of 589H from the data segment base.
MOV DS, CX ; Move the content of CX to DS
2. PUSH instruction
The PUSH instruction decrements the stack pointer by two and copies the word from source to the location where stack pointer now points. Here the source must of word size data. Source can be a general purpose register, segment register or a memory location.
The PUSH instruction first pushes the most significant byte to sp-1, then the least significant to the sp-2.
Push instruction does not affect any flags.
Example:-
PUSH CX ; Decrements SP by 2, copy content of CX to the stack (figure shows execution of this instruction)
PUSH DS ; Decrement SP by 2 and copy DS to stack
3. POP instruction
The POP instruction copies a word from the stack location pointed by the stack pointer to the destination. The destination can be a General purpose register, a segment register or a memory location. Here after the content is copied the stack pointer is automatically incremented by two.
The execution pattern is similar to that of the PUSH instruction.
Example: POP CX ; Copy a word from the top of the stack to CX and increment SP by 2.
4. IN & OUT instructions
The IN instruction will copy data from a port to the accumulator. If 8 bit is read the data will go to AL and if 16 bit then to AX. Similarly OUT instruction is used to copy data from accumulator to an output port.
Both IN and OUT instructions can be done using direct and indirect addressing modes.
Example:
IN AL, 0F8H ; Copy a byte from the port 0F8H to AL
MOV DX, 30F8H ; Copy port address in DX
IN AL, DX ; Move 8 bit data from 30F8H port
IN AX, DX ; Move 16 bit data from 30F8H port
OUT 047H, AL ; Copy contents of AL to 8 bit port 047H
MOV DX, 30F8H ; Copy port address in DX
OUT DX, AL ; Move 8 bit data to the 30F8H port
OUT DX, AX ; Move 16 bit data to the 30F8H port
5. XCHG instruction
The XCHG instruction exchanges contents of the destination and source.
Here destination and source can be register and register or register and memory location, but XCHG cannot interchange the value of 2 memory locations.
General Format
XCHG Destination, Source
Example:
XCHG BX, CX ; exchange word in CX with the word in BX
XCHG AL, CL ; exchange byte in CL with the byte in AL
XCHG AX, SUM[BX] ; here physical address, which is DS+SUM+[BX].
The content at physical address and the content of AX are interchanged.
1. What is the instruction set of the 8086 processor? | ![]() |
2. How many instructions are there in the 8086 instruction set? | ![]() |
3. Can the 8086 processor execute instructions from the 8088 instruction set? | ![]() |
4. Are there any limitations or restrictions in the 8086 instruction set? | ![]() |
5. Can the 8086 instruction set be extended or modified? | ![]() |