Which of the following is the correct sequence with regard to service routine?…

2025

Which of the following is the correct sequence with regard to service routine?
A. Save contents of processor registers
B. Turn the interrupt facility on
C. Service the device whose flag is set
D. Check which flag is set
E. Restore contents of processor registers
Choose the correct answer from the options given below:

  1. A.

    A, B, C, D, E

  2. B.

    D, B, C, A, E

  3. C.

    D, C, B, E, A

  4. D.

    A, D, C, E, B

Attempted by 323 students.

Show answer & explanation

Correct answer: D

Correct sequence for the service routine:

  1. Save contents of processor registers — preserve the CPU state so the interrupted program can resume correctly.

  2. Check which flag is set — identify the device or source that caused the interrupt before taking action.

  3. Service the device whose flag is set — perform the required I/O or handler actions for that device.

  4. Restore contents of processor registers — return the CPU to the state it had before the interrupt.

  5. Turn the interrupt facility on — re-enable interrupts only after the handler has completed to avoid nested or lost interrupts.

Summary: Save state first, identify the interrupt source, service it, restore state, then re-enable interrupts.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor