Which of the following must be true for the RFE (Return from Exception)…

2008

Which of the following must be true for the RFE (Return from Exception) instruction on a general purpose processor?

I.   It must be a trap instruction
II.  It must be a privileged instruction
III. An exception cannot be allowed to occur during 
     execution of an RFE instruction 

Answer: D. I, II and III onlyCorrect answer: I, II and III are all true. Reasoning: Statement I — "It must be a trap instruction": The return-from-exception must be treated specially so…

  1. A.

    I only

  2. B.

    II only

  3. C.

    I and II only

  4. D.

    I, II and III only

Attempted by 103 students.

Show answer & explanation

Correct answer: D

Correct answer: I, II and III are all true. Reasoning:

  • Statement I — "It must be a trap instruction":

    The return-from-exception must be treated specially so that attempts to execute it from an unauthorized (user) context cause a trap. In practice this means the instruction is defined to trap when executed illegally, ensuring the system can enforce privilege boundaries.

  • Statement II — "It must be a privileged instruction":

    RFE changes processor mode and restores privileged state (program counter, status bits, privilege level). Allowing unprivileged code to execute it would let user programs escape protection, so it must be a privileged instruction.

  • Statement III — "An exception cannot be allowed to occur during execution of an RFE instruction":

    Restoring processor state must be atomic and consistent. If another exception were to occur while the RFE is partially completed, the processor state could become inconsistent and the original return might fail. Therefore RFE must execute without being interrupted by another exception (or the architecture must define a safe, well-specified behavior).

Putting these points together shows that all three statements describe required properties of a Return-from-Exception instruction in a general-purpose processor.

Explore the full course: Isro

Loading lesson…