OR
The keyboard controller can hold only a single keystroke. Therefore, the keyboard controller must be freed before the next keystroke arrives.
The keystroke is passed to the CPU by putting it in the keyboard buffer. So, the keyboard controller keeps on passing the keystroke input to the CPU,
but how does the CPU attend to it? The CPU is not at the disposal of the keyboard controller; it is usually busy doing several other operations. So, we need some mechanism to indicate to the CPU that a keystroke has arrived. How is this done? There are two approaches to making sure that the CPU pays attention:
The Purpose of Interrupts...
Interrupts are useful when interfacing I/O devices at relatively low data transfer rates, such as keyboard inputs.
Interrupt processing allows the processor to execute other software while the keyboard operator is thinking about what to type next. When a key is pressed, the keyboard encoder debounces the switch and puts out one pulse that interrupts the microprocessor.
TYPES OF INTERRUPT
There are instructions in 8086 which cause an interrupt.
The primary sources of interrupts, however, are the PCs timer chip, keyboard, serial ports, parallel ports, disk drives, CMOS real-time clock, mouse, sound cards, and other peripheral devices.
The interrupt vector table for the microprocessor and (b) the contents of an interrupt vector.�
TYPE 0
The divide error : whenever the results from a division overflows or an attempt is made to divide by zero.
Type 2
The non-maskable interrupt occurs when a logic 1 is placed on the NMI input pin to the microprocessor. non-maskable—it cannot be disabled
Type 3
A special one-byte instruction (INT 3) that uses this vector to access its interrupt-service procedure. often used to store a breakpoint in a program for debugging
TYPE 4
�Overflow is a special vector used with the INTO instruction. The INTO instruction interrupts the program if an overflow condition exists.
TYPE 5
The BOUND instruction compares a register with boundaries stored in the memory. If the contents of the register are greater than or equal to the first word in memory and less than or equal to the second word, no interrupt occurs because the contents of the register are within bounds. if the contents of the register are out of bounds, a type 5 interrupt ensues as reflected by the overflow flag (OF)
Type 7
The coprocessor not available interrupt occurs when a coprocessor is not found, as dictated by the machine status word (MSW or CR0) coprocessor control bits. if an ESC or WAIT instruction executes and no coprocessor is found, a type 7 exception or interrupt occurs
Type 8
�A double fault interrupt is activated when two separate interrupts occur during the same instruction.
In computing, a double fault is a serious type of error that occurs when a central processing unit (CPU) cannot adequately handle a certain type of system event that requires the CPU’s immediate attention. Double faults may cause computer crashes and error messages, automatic restarting of the machine, and the loss of any unsaved data. They are often caused by problems in the computer’s hardware such as a bad memory module or overheating CPU.
Type 9
�The coprocessor segment overrun occurs if the ESC instruction (coprocessor opcode) memory operand extends beyond offset address FFFFH in real mode.
A stack segment overrun occurs if the stack segment is not present (P = 0) in the protected mode or if the limit of the stack segment is exceeded.
�The general protection fault occurs for most protection violations in 80286–Core2 in protected mode system.
�These errors occur in Windows as general protection faults. A list of these protection violations follows.
PROTECTION VIOLATIONS
(cont.)
Type 14
�Page fault interrupts occur for any page�fault memory or code access in 80386, 80486, and Pentium–Core2 processors.
Type 16
Coprocessor error takes effect when a coprocessor error (ERROR = 0) occurs for ESCape or WAIT instructions for 80386, 80486, and Pentium–Core2 only.
�Alignment checks indicate word and double word data are addressed at an odd memory location (or incorrect location, in the case of a double word). interrupt is active in 80486 and Pentium–Core2
Type 18
A machine check activates a system memory management mode interrupt in Pentium–Core2.