There are 2 types interrupts in 8085 such as: 1)hardware interrupt 2)software interrupt
(Q)What are Hardware and software interrupt? draw the block daigram of 8259 interrupt controller and explain in brief..
The difference is that a hardware interrupt is a signal relayed to a system's CPU directly because of some piece of hardware, such as a keyboard or mouse. A software interrupt is a signal sent to indicate that something within a piece of software requires attention.
software interrupts
The TRAP interrupt can not be masked by software, unless there is hardware in place to allow that, perhaps by anding an output bit with the TRAP request line.
Interrupt signals initiated by programs are called software interrupts. A software interrupt is also called a trap or anexception. A signal informing a program that an event has occurred. When a program receives an interrupt signal, it takes a specified action (which can be to ignore the signal). Interrupt signals can cause a program to suspend itself temporarily to service the interrupt. Interrupt signals can come from a variety of sources. For example, every keystroke generates an interrupt signal. Interrupts can also be generated by other devices, such as a printer , to indicate that some event has occurred. PCs support 256 types of software interrupts and 15 hardware interrupts. Each type of software interrupt is associated with an interrupt handler -- a routine that takes control when the interrupt occurs. For example, when you press a key on your keyboard, this triggers a specific interrupt handler. The complete list of interrupts and associated interrupt handlers is stored in a table called the interrupt vector table , which resides in the first 1 K of addressable memory.
Hardware Interrupt: Each CPU has External Interrupt lines(about 7). Other external devices line keyboard, Mouse, Other controllers can send signals to CPU asynchronously. Software Interrupt:is an interrupt generated with in a processor by executing an instruction . Software interrupt are often used to implemented system calls because they implemented a subroutine call with a CPU ring level change.
software
Interrupt generated by executing an instruction is called software interrupt. It's also called 'trap'. Software interrupts are generally used to make system calls i.e. to request operating system to perform an I/O operation or to run a new program.Examples:C++:A cout or cin statement would generate a software interrupt because it would make a system call to print something.A fork() statement in Linux would generate a software interrupt because it would make a system call to create a new process.Assembly IA32:The instruction int 21h would generate a software interrupt which would request something from operating system (depending on the register values).
The 8086 interrupt priorities are concerned ,software interrupt have the highest priority,followed by NMI ,followed by INTR.The lowest priority signals are unmaskable interrupts.
A hardware interrupt is initiated from a hardware event, such as a byte received from a serial port. It is asynchronous to the running program, i.e. it can occur at any time. An internal, or software, interrupt is initiated by the running program, thus it is under the control of the running program. In the 8085, for instance, the RST instructions are software interrupts. Note, however, that external interrupts can initiate a software RST instruction, so the two events can appear to be the same kind of event. The biggest difference is the handling of the interrupt enable (IE) flag. In the hardware interrupt, the IE flag is turned off when processing the interrupt, and it is turned on right before the interrupt service routine executes the final return instruction. The software interrupt, on the other hand, has nothing to do with IE. As a result, the code must be able to tell the difference.
The first is the real interrupt, when the external hardware interrupts the processors' work;the second is the exception, like page fault or division by zero;the third is the supervisor call (SVC) which is sometimes called interrupt (or 'software interrupt') as well.