Open In App

Interrupts in 8086 microprocessor

Last Updated : 24 Jun, 2022
Like Article

An interrupt is a condition that halts the microprocessor temporarily to work on a different task and then returns to its previous task. An interrupt is an event or signal that requests the CPU’s attention. This halt allows peripheral devices to access the microprocessor. Whenever an interrupt occurs, the processor completes the current instruction and starts the implementation of an Interrupt Service Routine (ISR) or Interrupt Handler. ISR is a program that tells the processor what to do when the interrupt occurs. After the ISR execution, control returns to the main routine where it was interrupted. In the 8086 microprocessor following tasks are performed when the microprocessor encounters an interrupt:

  1. The value of the flag register is pushed into the stack. It means that first, the value of SP (Stack Pointer) is decremented by two then the value of the flag register is pushed to the memory address of the stack segment.
  2. The value of starting memory address of CS (Code Segment) is pushed into the stack.
  3. The value of IP (Instruction Pointer) is pushed into the stack.
  4. IP is loaded from word location (Interrupt type) * 04.
  5. CS is loaded from the following word location.
  6. Interrupt, and Trap flags are reset to 0.

The different types of interrupts present in the 8086 microprocessor are given by:

  1. Hardware Interrupts – Hardware interrupts are those interrupts that are caused by any peripheral device by sending a signal through a specified pin to the microprocessor. There are two hardware interrupts in the 8086 microprocessor. They are:
    • NMI (Non-Maskable Interrupt): It is a single pin non-maskable hardware interrupt that cannot be disabled. It is the highest priority interrupt in the 8086 microprocessor. After its execution, this interrupt generates a TYPE 2 interrupt. IP is loaded from word location 00008 H, and CS is loaded from the word location 0000A H.
    • INTR (Interrupt Request): It provides a single interrupt request and is activated by the I/O port. This interrupt can be masked or delayed. It is a level-triggered interrupt. It can receive any interrupt type, so the value of IP and CS will change on the interrupt type received.
  2. Software Interrupts – These are instructions inserted within the program to generate interrupts. There are 256 software interrupts in the 8086 microprocessor. The instructions are of the format INT type, where the type ranges from 00 to FF. The starting address ranges from 00000 H to 003FF H. These are 2-byte instructions. IP is loaded from type * 04 H, and CS is loaded from the following address given by (type * 04) + 02 H. Some important software interrupts are:
    • TYPE 0 corresponds to division by zero(0).
    • TYPE 1 is used for single-step execution for debugging the program.
    • TYPE 2 represents NMI and is used in power failure conditions.
    • TYPE 3 represents a break-point interrupt.
    • TYPE 4 is the overflow interrupt.

Previous Article
Next Article

Similar Reads

Flag register of 8086 microprocessor
Prerequisite – Flag register in 8085 microprocessor The Flag register is a Special Introduction : The flag register is a 16-bit register in the Intel 8086 microprocessor that contains information about the state of the processor after executing an instruction. It is sometimes referred to as the status register because it contains various status fla
6 min read
General purpose registers in 8086 microprocessor
General-purpose registers are used to store temporary data within the microprocessor. There are 8 general-purpose registers in the 8086 microprocessor. [caption width="800"] [/caption] 1. AX: This is the accumulator. It is of 16 bits and is divided into two 8-bit registers AH and AL to also perform 8-bit instructions. It is generally used for arith
2 min read
Arithmetic instructions in 8086 microprocessor
Arithmetic Instructions are the instructions which perform basic arithmetic operations such as addition, subtraction and a few more. Unlike in 8085 microprocessor, in 8086 microprocessor the destination operand need not be the accumulator. Following is the table showing the list of arithmetic instructions: OPCODE OPERAND EXPLANATION EXAMPLE ADD D,
2 min read
Logical instructions in 8086 microprocessor
Introduction : Logical instructions in the 8086 microprocessor are instructions that perform logical operations on data stored in registers or memory locations. These instructions can manipulate bits within a byte, set or clear individual bits, or perform Boolean operations such as AND, OR, XOR, and NOT. Some of the commonly used logical instructio
5 min read
Data transfer instructions in 8086 microprocessor
Introduction : Data transfer instructions in the 8086 microprocessor are used to move data between memory locations, registers, and input/output (I/O) devices. These instructions are essential for manipulating data within a program, as well as for communicating with external devices. Data transfer instructions are a fundamental part of programming
4 min read
Reset Accumulator (8085 & 8086 microprocessor)
1. Problem - Write the 8085 instructions which reset the accumulator. Solution - There are 4 instructions to reset the accumulator in 8085. These instructions are: S.No.MNEMONICSCOMMENT1MVI A, 00A <- 002ANI 00A AND 003XRA AA XOR A4SUB AA <- A - A Explanation - MVI A, 00: instruction copies 00 to A.ANI 00: instruction performs bit by bit AND o
4 min read
Process control instructions in 8086 microprocessor
Process control instructions are the instructions which control the processor's action by setting(1) or resetting(0) the values of flag registers. Following is the table showing the list of process control instructions: OPCODEOPERANDEXPLANATIONEXAMPLESTCnonesets carry flag to 1STCCLCnoneresets carry flag to 0CLCCMCnonecompliments the carry flagCMCS
1 min read
Memory Segmentation in 8086 Microprocessor
Prerequisite - Segmentation Segmentation is the process in which the main memory of the computer is logically divided into different segments and each segment has its own base address. It is basically used to enhance the speed of execution of the computer system, so that the processor is able to fetch and execute the data from the memory easily and
3 min read
Differences between 8085 and 8086 microprocessor
8085 Microprocessor 8085 Microprocessor is a predecessor of version 8086 Microprocessor, designed by Intel in 1976 with the help of NMOS technology. It includes a data bus of 8 bits, and 16 bits of the address bus, having a +5V voltage supply, and operates at 3.2 MHz single segment CLK. It has an internal clock generator and functions on a clock cy
4 min read
Addressing modes in 8086 microprocessor
Prerequisite - Addressing modes, Addressing modes in 8085 microprocessor The way of specifying data to be operated by an instruction is known as addressing modes. This specifies that the given data is an immediate data or an address. It also specifies whether the given operand is register or register pair. Types of addressing modes: Register mode -
2 min read