先决条件– 8085微处理器中断
1.硬件中断:
硬件中断是由某些硬件设备引起的,例如启动I / O的请求,硬件故障或类似原因。引入硬件中断是为了避免浪费处理器在轮询循环中等待外部事件的宝贵时间。
例如,当完成I / O操作(例如,从磁带机读取一些数据到计算机中)时。
2.软件中断:
通过使用INT指令可以调用软件中断。此事件立即停止程序执行,并将执行传递给INT处理程序。 INT处理程序通常是操作系统的一部分,并确定要采取的措施。当应用程序终止或从操作系统请求某些服务时,就会发生这种情况。
例如,输出到屏幕,执行文件等。
硬件中断和软件中断之间的区别:
SR.NO. | Hardware Interrupt | Software Interrupt |
---|---|---|
1 | Hardware interrupt is an interrupt generated from an external device or hardware. | Software interrupt is the interrupt that is generated by any internal system of the computer. |
2 | It do not increment the program counter. | It increment the program counter. |
3 | Hardware interrupt can be invoked with some external device such as request to start an I/O or occurrence of a hardware failure. | Software interrupt can be invoked with the help of INT instruction. |
4 | It has lowest priority than software interrupts | It has highest priority among all interrupts. |
5 | Hardware interrupt is triggered by external hardware and is considered one of the ways to communicate with the outside peripherals, hardware. | Software interrupt is triggered by software and considered one of the ways to communicate with kernel or to trigger system calls, especially during error or exception handling. |
6 | It is an asynchronous event. | It is synchronous event. |
7 | Hardware interrupts can be classified into two types they are: 1. Maskable Interrupt. 2. Non Maskable Interrupt. | Software interrupts can be classified into two types they are: 1. Normal Interrupts. 2. Exception |
8 | Keystroke depressions and mouse movements are examples of hardware interrupt. | All system calls are examples of software interrupts |