Shri vishnu engineering college for women:: bhimavaram department of information technology



Download 3.29 Mb.
View original pdf
Page26/128
Date12.04.2022
Size3.29 Mb.
#58595
1   ...   22   23   24   25   26   27   28   29   ...   128
ITIIBTechIISemLecCOA
0910-ComputerSystemOverview02
UNIT-1

DEPARTMENT OF INFORMATION TECHNOLOGY::SVECW Page 16 Figure 1.10 Transfer of Control via Interrupts To accommodate interrupts, an interrupt cycle is added to the instruction cycle, as shown in Figure 1.11. Figure Instruction Cycle with Interrupts In the interrupt cycle, the processor checks to see if any interrupts have occurred. If no interrupts are pending, the processor proceeds to the fetch cycle and fetches the next instruction of the current program. If an interrupt is pending, the processor does the following
• It suspends execution of the current program being executed and saves its context
• It sets the program counter to the starting address of an interrupt handler routine. The processor now proceeds to the fetch cycle and fetches the first instruction in the interrupt handler program, which will service the interrupt. When the interrupt handler routine is completed, the processor can resume execution of the user program at the point of interruption. Consider Figure 1.12, which is a timing diagram based on the flow of control in Figures a and b. Figure c indicates this state of affairs. In this case, the user program reaches the second WRITE call before the IO operation spawned by the first call is complete. The result is that the user program is hung up at that point.
When the preceding IO operation is completed, this new WRITE call maybe processed, and anew IO operation maybe started. Figure 1.13 shows the timing for this situation with and without the use of interrupts. We can see that there is still again inefficiency because part of the time during which the IO operation is underway overlaps with the execution of user instructions.



Download 3.29 Mb.

Share with your friends:
1   ...   22   23   24   25   26   27   28   29   ...   128




The database is protected by copyright ©ininet.org 2024
send message

    Main page