Instruction Set of 8086 Microprocessor

We know that instructions are the binary commands used for the execution of any operation. In the previous article, we have discussed the instruction set of the 8085 microprocessor. Here in this article, we will discuss the instruction set supported by the 8086 microprocessor.

8086 supports various instructions including those supported by 8085. However, 8086 supports some additional instructions.

So, let us move further and understand the various instructions supported by the 8086 microprocessor.

Instruction set of 8086 microprocessor

The instruction set in 8086 microprocessor are classified as follows:

instruction set of 8086 microprocessor

Let us now understand each type of instructions in detail.

Data Transfer Instruction

This group includes the instructions used for moving the data from one place to another. In data transfer group of instructions data or address can be transferred to either register, memory or I/O ports.

In order to accomplish any transfer, the source and destination must be known. So, these instructions involve two operands i.e., the source and the destination. The size of the operand must be the same.

The source holds either the immediate data, register or memory location. While the destination holds either the address of any memory location or register.

The various data transfer instructions are as follows:instruction 1

The data present in register 1 is transferred to register 2 or memory location given in the operand.

instruction 2

The data present in the memory is transferred to register 2.instruction 3

The immediate data is present in the operand is transferred to the memory location or the given register.

instruction 4

If the data in the memory is of 8-bit, then it is transferred to the lower address bit of the accumulator. And if the data is of 16-bit then it is transferred to the higher-order address of the accumulator.instruction 5

If AL is present as the operand, then 8-bit data at the accumulator is transferred to the memory. While in the case of AX, 16-bit data at the accumulator is transferred.

instruction 6

It allows the transfer of 16-bit data present in the memory or register present as an operand to the stack memory. This stack memory is generated when SP is decremented by 2.

instruction 7

The data present in the stack memory is transferred to either 16-bit register or memory location given in the operand and SP gets incremented by 2.

instruction 8

It allows the exchange of data between two registers or a register to memory location.

instruction 9

The data present in the input port is transferred to accumulator and its address is present in the DX register given in the operand.

instruction 10

The data of the input port is moved to the accumulator whose memory address is given in the instruction.

instruction 11

The data in the accumulator is moved to the output port whose address is specified in the DX register.

instruction 12

The data in the accumulator is moved to the port whose address is given in the instruction.

instruction 13

This instruction loads the register with the effective address of the memory location.

instruction 14

The data is in the first two memory location is moved to the register and from the next two memory locations is moved to DS register.

instruction 15

The lower byte of the data of the flag register is moved to the higher byte register of the accumulator.

instruction 16

It moves the data in the higher byte of flag register to the lower byte flag register.

Arithmetic Instructions

These instructions are used in order to execute arithmetic instructions like addition, subtraction, multiplication, division, increment or decrement.

The flags of the 8086 microprocessor are altered when arithmetic and logical instructions are executed. Basically, the status of the result of the operations is reflected by the flag.

instruction 17

The data in the two registers are added and output is stored in register 2.

instruction 18

The immediate data in the operand is added with the data present in the register and the result is stored in that particular register.

instruction 19

This instruction adds the data given in the operand with the data in the accumulator and the result is loaded in the accumulator.

instruction 20

The data in the two registers are added along with the bit of the carry flag. And the result is stored in register 2.

instruction 21

The data in the operand is added with the data in the memory location with the carry flag. And the outcome of the operation is stored in the memory.

instruction 22

The immediate data is added with the accumulator’s content and is stored in the accumulator.

instruction 23

When two ASCII data are added then this instruction is used for the conversion of the result in the accumulator in order to perform correction of unpacked BCD.

instruction 24

When two packed BCD data are added then executing this instruction will change the result in the accumulator to packed BCD data.

instruction 25

The data of the register 1 is subtracted from register 2 and the result is stored in register 2.

instruction 26

The immediate data in the operand is subtracted from the data in the memory and memory stores the result of the operation.

instruction 27

The immediate data is subtracted from the data in the accumulator and the outcome is stored by the accumulator.

instruction 28

The register 2 holds the result of subtraction of data in register 1 and carry bit from the data in the register 2.

instruction 29

The immediate data and a carry bit are subtracted from the data in the register and the register in the operand holds the result of the operation.

instruction 30

The immediate data and carry bit is subtracted from the data in the accumulator and the accumulator itself holds the result of the subtraction.

instruction 31

When the subtraction of ASCII data is performed then this instruction converts the results of the accumulator to perform correction of unpacked BCD.

instruction 32

The unsigned data in the register is multiplied with the unsigned data in the accumulator and the AX register holds result in 8-bit operation and AX and DX stores the result in 16-bit operation.

instruction 33

The signed data in the register is multiplied with the signed data present in the accumulator and the outcome of the operation is stored in AX and DX registers.

instruction 34

The outcome of multiplication of unpacked BCD data is a binary value stored in the AX register. So, this instruction is used for the conversion of binary data into unpacked BCD.

instruction 35

The unsigned binary data in the accumulator is divided by the unsigned binary data in the register. The AL register stores the quotient and AH register stores the remainder.

instruction 36

This instruction generates the 2’s complement of the data present in the register or memory. Simply put changes the sign of the data.

instruction 37

The data of the register or memory specified in the operand is incremented by 1.

instruction 38

The data in the specified register or memory location is decremented by 1.

instruction 39

The status of the flag register is modified by comparing the data of the two registers without altering the data of the registers. Subtraction is used for comparison.

instruction 40

It also performs comparison operation but this time the comparison is performed between the data in register and memory.

instruction 41

The data at the accumulator is compared with the immediate data given in the operand to modify the flag.

Logical Instructions

These instructions perform operations like AND, OR, complement, shift and rotate on the binary data. The outcome of the operation executed by logical instructions is represented as the status of flag register.

instruction 42

AND operation over each bit of two registers is performed and register 2 stores the result.

instruction 43

The immediate data is ANDed with the data present in the accumulator. And the accumulator stores the result.

instruction 44

The data in register 1 is logically ORed with the data in memory and the result is stored in that memory location.

instruction 45

The immediate data in the operand is ORed with the data in the accumulator. And AL and AX store the result of the operation.

instruction 46

Exclusive OR operation is performed by this instruction on the data present in register 1 and 2 and register 2 holds the result of the operation.

instruction 47

This instruction performs AND operation of the data present in two registers and the output is used to modify the status of flag register.

instruction 48

It generates a complement of data present in register or memory.

instruction 49

The data byte of register or memory given in the operand is shifted to the left. The MSB of the data shifts to carry flag and LSB becomes 0.

instruction 50

The data byte is shifted to the right. So, now LSB shifts to carry flag and MSB becomes 0.

instruction 51

The data byte in the register or memory is rotated left and the MSB is transferred to both LSB and carry flag.

instruction 52

The data byte of register or memory is rotated left the LSB is loaded with CF and CF is loaded with MSB.

instruction 53

It rotates the data byte in the right direction and this time LSB is transferred to both MSB and CF.

instruction 54

The data byte in register or memory is rotated right, the CF is transferred to MSB and LSB is transferred to CF.

String Manipulation Instruction

A sequence of bytes or words forms a string. This instruction set contains instructions for movement, comparison, scanning, loading or storing of the string.

instruction 55

Whenever prefix of this instruction is present in any string instruction. Then it allows repeated execution of that instruction until the ZF becomes 0.

instruction 56

This instruction allows the repetitive execution of the string instruction until the ZF becomes 1.

instruction 57

It is used for comparison of string bytes or words. The byte/word of string data present in extra segment is subtracted from that of the data segment and the result modifies the status of the flags.instruction 58

It subtracts the byte of string data in the extra segment from the data in the accumulator and modifies the flags.

instruction 59

The string byte of data present in the data segment is copied to accumulator and the SI automatically increments/decrements itself on the basis of direction flag.

instruction 60

The data in the accumulator is stored as a string byte in extra segment and DI automatically gets incremented/decremented on the basis of direction flag.

Control Transfer Instruction

This set consists of instructions like call, jump, loop and software interrupt instructions that basically controls the operation of the processor. These instructions do not modify the status of flag registers.

instruction 61

This instruction transfers the control to the effective address within the segment stored in the register or memory location specified in the operand.

instruction 62

RET transfers the control to the actual program/ procedure from the previously called procedure.

instruction 63

The 16-bit data in the instruction is added to the data in IP.

instruction 64

The 8-bit data is converted into 16-bit and added with the data in IP.

instruction 65

The 16-bit data present in the register or memory is added with the data in the IP and IP stores the result.

instruction 66

A group of instructions is repeatedly executed until CX reaches 0 as CX is continuously decremented by 1 after each execution.

instruction 67

This instruction is a software interrupt which is used to call a service routine.

Processor Control Instruction

This set includes instructions for setting or clearing the carry, direction and interrupt flags inside the processor.

instruction 68

It is used to reset the carry flag to 0.

instruction 69

This instruction generates a complemented value of CF.

instruction 70

It sets the CF to 1.

instruction 71

This sets the interrupt flag to 1.

instruction 72

This resets the interrupt flag to 0.instruction 73

This instruction takes the processor to halt/idle state by terminating the current execution.

So, this is all about the instruction sets of the 8086 microprocessor.

Leave a Comment

Your email address will not be published. Required fields are marked *