Interrupts and interrupt applications

8086 Interrupts And Interrupt Applications

Introduction:

Microprocessors are computing machines built on individual IC. There can be more IC ‘s besides used for this. Most microprocessors allow normal plan executing to be interrupted by some external signal or by a particular direction in the plan. In response to an interrupt the microprocessor stops put to deathing its current plan and calls a process which sevices the interrupt. An IRET direction at the terminal

of the interrupt service process returns executing to the interrupted plan.

8086 Interrupts And Interrupt Responses:

An 8086 interrupt can come from any one of three beginnings. One beginning is an external signal applied to the non-maskable interrupt ( NMI ) input pin or to the interrupt input pin. An interrupt caused by a signal applied to one of these inputs is referred to as a hardware interrupt. A 2nd beginning of an interrupt is executing of the interrupt direction. This is referred to as a package interrupt. The 3rd beginning of an interrupt is some error status produced in the 8086 by the executing of an direction. An illustration of this is the divide by nothing interrupt. If you attempt to split an operand by nothing, the 8086 will automatically disrupt the presently put to deathing plan. At the terminal of each direction rhythm, the 8086 cheques to see if any interrupts have been requested. If an interrupt has been requested, the 8086 responds to the interrupt by stepping through the undermentioned series of major actions:

1 ) It decrements the stack arrow by 2 and pushes the flag registry on the stack.

2 ) It disables the 8086 INTR interrupt input by uncluttering the interrupt flag in the flag registry.

3 ) It resets the trap flag in the flag registry.

4 ) It decrements the stack arrow by 2 and pushes the current codification section registry contents on the stack.

5 ) It decrements the stack arrow once more by 2 and pushes the current direction arrow contents on the stack.

8086 Interrupt Types:

The preceding subdivisions used the type 0 interrupts an illustration of how the 8086 interrupts map. It has hardware caused NMI interrupt, the package interrupts produced by the INT direction, and the hardware interrupt produced by using a signal to the INTR input pin.

DIVIDE-BY-ZERO INTERRUPT-TYPE 0:

The 8086 will automatically make a type 0 interrupt if the consequence of a DIV operation or an IDIV operation is excessively big to suit in the finish registry. For a type 0 interrupt, the 8086 pushes the flag registry on the stack, resets IF and TF and pushes the return addresses on the stack.

Individual STEP INTERRUPT-TYPE 1:

The usage of individual measure characteristic found in some proctor plans and debugger plans. When you tell a system to individual measure, it will put to death one direction and halt. If they are right we can state a system to individual measure, it will put to death one direction and halt. We can so analyze the contents of registries and memory locations. In other words, when in individual measure mode a system will halt after it executes each direction and delay for farther way from you. The 8086 trap flag and type 1 interrupt response make it rather easy to implement a individual measure feature way.

NONMASKABLE INTERRUPT-TYPE 2:

The 8086 will automatically make a type 2 interrupt response when it receives a low to high passage on its NMI pin. When it does a type 2 interrupt, the 8086 will force the flags on the stack, reset TF and IF, and force the CS value and the IP value for the following direction on the stack. It will so acquire the CS value for the start of the type 2 interrupt service process from reference 0000AH and the IP value for the start of the process from address 00008H.

BREAKPOINT INTERRUPT-TYPE 3:

The type 3 interrupt is produced by executing of the INT3 direction. The chief usage of the type 3 interrupt is to implement a breakpoint map in a system. When we insert a breakpoint, the system executes the instructions up to the breakpoint and so goes to the breakpoint process. Unlike

the individual measure which stops executing after each direction, the breakpoint characteristic executes all the instructions up to the inserted breakpoint and so stops executing.

OVERFLOW INTERRUPT-TYPE4:

The 8086 overflow flag will be set if the signed consequence of an arithmetic operation on two signed Numberss is excessively big to be represented in the finish registry or memory location. For illustration, if you add the 8 spot signed figure 01101100 and the 8 spot signed figure 010111101, the consequence will be 10111101. This would be the right consequence if we were adding unsigned binary Numberss, but it is non the correct signed consequence.

SOFTWARE INTERRUPTS-TYPE O THROUGH 255:

The 8086 INT direction can be used to do the 8086 to make any one of the 256 possible interrupt types. The coveted interrupt type is specified as portion of the direction. The direction INT32, for illustration will do the 8086 to make a type 32 interrupt response. The 8086 will force the flag registry on the stack, reset TF and IF, and force the CS and IP values of the following direction on the stack.

INTR INTERRUPTS-TYPES 0 THROUGH 255:

The 8086 INTR input allows some external signal to disrupt executing of a plan. Unlike the NMI input, nevertheless, INTR can be masked so that it can non do an interrupt. If the interrupt flag is cleared, so the INTR input is disabled. IF can be cleared at any clip with Clear direction.

Precedence OF 8086 Interrupt:

If two or more interrupts occur at the same clip so the highest precedence interrupt will be serviced first, and so the following highest precedence interrupt will be serviced. As a illustration suppose that the INTR input is enabled, the 8086 receives an INTR signal during the executing of a divide direction, and the divide operation produces a divide by nothing interrupt. Since the internal interrupts-such as divide mistake, INT, and INTO have higher precedence than INTR the 8086 will make a divide mistake interrupt response foremost.

Hardware Interrupt Applications:

Simple Interrupt Data Input:

One of the most common utilizations of interrupts is to alleviate a CPU of the load of canvassing. To review your memory canvassing plants as follows. The stroboscope or informations ready signal from some external device is connected to an input port line on the personal computer. The personal computer uses a plan cringle to read and prove this port line over and over until the informations ready signal is found to be asserted. The personal computer so exits the polling cringle and reads in the information from the external device. The disadvantage of polled input or end product is that while the personal computer is canvassing the stroboscope or informations ready signal, it can non easy be making other undertakings. I n this instance the informations ready or strobe signal is connected to an interrupt input on the personal computer. The personal computer so goes about making its other undertakings until it is interrupted by a informations ready signal from the external device. An interrupt service process can read in or direct out the coveted informations in a few microseconds and return executing to the interrupted plan. The input and end product operation so uses merely a little per centum of the microprocessors clip.

Counting Applications:

As a simple illustration of the usage of an interrupt input for numeration, suppose that we are utilizing an 8086 to command a printed circuit board doing machine in our computerized electronics mill. Further suppose that we want to observe each finished board as it comes out of the machine and to maintain a count with the figure of boards fed in. This manner we can find if any boards were lost in the machine. To make this count on an interrupt footing, all we have to make is to observe when a board passes out of the machine and direct an interrupt signal to an interrupt input on the 8086. The interrupt service process for that input can merely increment the board count stored in a named memory location. To observe a board coming out of the machine, we use an infrared LED, a photoresistor and two conditioning Gatess. The LED is positioned over the path where the boards come out, and the photoresistor is positioned below the path. When no board is between the LED and the photoresistor, the visible radiation from the LED will strike the photoresistor and turn it on. The aggregator of the photoresistor will so be low, as will the NMI input on the 8086. When a board passes between the LED and photoresistor, the visible radiation will non make the photoresistor and turn it on. The aggregator of the photoresistor will so be low, as will the NMI input on the 8086.

Clocking Applications:

In this it is shown that how delay cringle could be used to put the clip between personal computer operations. In the illustration at that place, we used a hold cringle to take in informations samples at 1 MS intervals. The obvious disadvantage of a hold cringle is that while the personal computer is stuck in the hold cringle, it can non easy be making other utile work. In many instances a hold cringle would be a waste of the personal computer ‘s valuable clip, so we use an interrupt attack. Suppose for illustration, that in our 8086 controlled printed circuit board doing machine we need to look into the pH of a solution about every 4 min. If we used a hold cringle to number off the 4 min, either the 8086 would n’t be able to make much else or what points in the plan to travel look into the pH.

8254 Software-Programmable Timer/Counter:

Because of many undertakings that they can be used for in personal computer systems, programmable timer/counters are really of import for you to larn approximately. As you read through following subdivisions, pay peculiar attending to the applications of this device in systems and the general processs for initialising a programmable device such as 8254.

Basic 8253 And 8254 Operation:

The intel 8253 and 8254 each contain three 16 spot counters which can be programmed to run in several different manners. The major differences are as follows:

1 ) The maximal input clock frequence for the 8253 is 2.6 MHz, the maximal clock frequence for the 8254 is 8MHz.

2 ) The 8254 has a read back characteristic which allows you to latch the count in all the counters and the position of the counter at any point. The 8253 does non hold this read back characteristic. The large advantage of these counters, nevertheless, is that you can lade a count in them, get down them and halt them with instructions in your plan. Such a device is said to be package programmable.

8259a Priority Interrupt Controller:

In a little system, for illustration, we might read ASCII characters in from a keyboard on an interrupt footing ; count interrupts from timer to bring forth a existent clip clock of 2nd, proceedingss and hours and detect several exigency or occupation done conditions on an interrupt footing. Each of these interrupt applications requires a separate interrupt input. If we are working with an 8086, we have job here because the 8086 has merely two interrupt inputs, NMI and INTR. If we save NMI for a power failure interrupt, this leaves merely one input for all the other applications. For applications where we have interrupts from multiple beginnings, we use an external device called a precedence interrupt accountant.

Software Interrupt Applications:

The package interrupt direction INT N can be used to prove any type of interrupt process. For illustration to prove a type 64 interrupt process without the demand for external hardware, we can put to death the direction INT 64.

Another of import usage of package interrupts is to name Basic Input Output System, or BIOS, procedures in an IBM PC-type computing machine. These processs in the system ROMS perform specific input or end product maps, such as reading a character from the keyboard, composing some characters to the CRT, or reading some information from a disc. To name one of these processs, you load any needed parametric quantities in some specified registries and put to death an INT N direction. N in this instance is the interrupt type which vectors to the coveted process. Suppose that, as portion of an assembly linguistic communication plan that you are composing to run on an IBM Personal computer type computing machine, you want to direct some characters to the pressman. The heading for the INT 17H process from the IBM PC BIOS listing. The DX, AH, and AL registries are used to go through the needed parametric quantities to the process. The process is used for two different operations: initialising the pressman port and directing a character to the pressman. The operation performed by the process is determined by the figure passed to the process in the AH registry. AH=1 means initialise the pressman port, AH=0 means print the characters in AL, and AH=2 means read the pressman position and returned in AH. If an effort to publish a character was non successful for some ground, such as the pressman non being turned on, non being selected, or being busy, 01 is returned in AH. The chief advantage of naming processs with package interrupts is that you do n’t necessitate to worry about the absolute reference where the process really resides or about seeking to associate the process into your plan. So at last every personal computer system uses a assortment of interrupts and this is all about 8086 interrupts and applications.

Decision:

Microprocessors are computing machines built on individual IC. There can be more IC ‘s besides used for this. Most microprocessors allow normal plan executing to be interrupted by some external signal or by a particular direction in the plan. In response to an interrupt the microprocessor stops put to deathing its current plan and calls a process which sevices the interrupt. An IRET direction at the terminal of the interrupt service process returns executing to the interrupted plan. An 8086 interrupt can come from any one of three beginnings. One beginning is an external signal applied to the non-maskable interrupt ( NMI ) input pin or to the interrupt input pin. An interrupt caused by a signal applied to one of these inputs is referred to as a hardware interrupt. A 2nd beginning of an interrupt is executing of the interrupt direction. This is referred to as a package interrupt. The 3rd beginning of an interrupt is some error status produced in the 8086 by the executing of an direction. An illustration of this is the divide by nothing interrupt. If you attempt to split an operand by nothing, the 8086 will automatically disrupt the presently put to deathing plan. At the terminal of each direction rhythm, the 8086 cheques to see if any interrupts have been requested. One of the most common utilizations of interrupts is to alleviate a CPU of the load of canvassing. To review your memory canvassing plants as follows. The stroboscope or informations ready signal from some external device is connected to an input port line on the personal computer. The personal computer uses a plan cringle to read and prove this port line over and over until the informations ready signal is found to be asserted. The package interrupt direction INT N can be used to prove any type of interrupt process. For illustration to prove a type 64 interrupt process without the demand for external hardware, we can put to death the direction INT 64. So at last we conclude that every personal computer system uses a assortment of interrupts and this is all about 8086 interrupts and applications.

Mentions:

1 ) DOUGLAS V.HALL, “microprocessors and interfacing” TaMcGRaw-Hill edition

2 ) www.wikipedia.com

3 ) www.google.com

July 14, 2017