Q50.Marks: +2.0UGC NET Paper 2: Computer Science 18th June 2024 Shift 1 (Cancelled)
Regarding the subroutines, see the following sequence of tasks to be performed:
A. Turn on the interrupt facility on.
B. Service the device whose flag is set.
C. Save the contents of processor registers.
D. Check which flag is set.
E. Restore the contents of processor registers.
Choose the correct answer from the options given below :
1.A, D, C, B, E
2.D, A, B, C, E
3.C, D, B, E, A✓ Correct
4.B, D, A, C, E
Solution
The correct answer is C, D, B, E, A
Key Points
To arrange the steps of handling subroutines in the correct order, let's understand the logical sequence:
Save the contents of processor registers (C)
The first step is to save the current state of the processor registers to ensure that the current process can be resumed correctly after the interrupt is serviced.
Check which flag is set (D)
Next, identify which device or event has triggered the interrupt by checking the flags.
Service the device whose flag is set (B)
Then, perform the necessary actions to service the device or handle the event that triggered the interrupt.
Restore the contents of processor registers (E)
After the device has been serviced, restore the processor registers to their previous state so that the interrupted process can continue correctly.
Turn on the interrupt facility on (A)
Finally, re-enable the interrupt facility to allow the system to handle future interrupts.