Interruption is caused by asynchronous external events. External events and interrupt responses do not have any relationship with the commands being executed. 80386 has two pins, Intr and NMI, that receive external interrupt request signals and intr accepts blocked interrupt requests. In 80386, The if flag in the flag register eflags determines whether to block blocked interrupt requests.
The processor must accept and process interrupt requests from NMI. In the 80386 system, the interrupt vector Number of the processor in response to NMI is fixed to 2. To avoid unblocking interruption nesting, when an NMI interrupt request is received, the processor automatically blocks all NMI interrupt requests until the NMI interrupt request is re-opened after the interrupt command iret is executed, therefore, NMI ProcessingProgramIt should end with the iret command.
What is blocking interruption? Interrupt allowed? How to implement it?
Interruption can be divided into two categories based on whether it can be blocked: unshielded interruption (also called unshielded interruption) and shielded interruption. Once a request is initiated, the CPU must respond unconditionally. However, the CPU can respond or not respond to requests that can be blocked. Two interrupt request input lines are generally set for the CPU: intr (Interrupt require) and NMI (nonmaskable
Interrupt ). For shielded interrupt, in addition to its own blocking bit control, it must also be subject to a general control, that is, the interrupt in the CPU flag register allows the flag bit if (iinterrupt
Flag) control, if BIT is 1, you can get the CPU response, otherwise, no response. The IF bit can be controlled by the user, and the command is sti or turbo.
The Enable () function of C clears the if bit 0 (off) by using the if position 1 (on interrupt), command CLI or the disable () function of turbo_c ).
A typical example of an unshielded interrupt source is a power failure. Once a power supply fails, it must respond immediately and unconditionally. Otherwise, it makes no sense to do anything else. A typical example of blocking the interrupt source is printer interruption. The CPU can respond to the printer interrupt request quickly or slowly, because it is enough to wait for the printer.
For Soft Interrupt, it is not affected by the if bit, so it belongs to the category of unshielded interrupt. Another point is that careful readers will think: the CPU only has two interrupt request input lines. What if there are multiple interrupt sources? Generally, external circuits are used.