GATE | GATE CS 2008 | Question 34
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
(A) I only
(B) II only
(C) I and II only
(D) I, II and III only
Explanation: RFE (Return From Exception) is a privileged trap instruction that is executed when exception occurs, so an exception is not allowed to execute.
In computer architecture for a general purpose processor, an exception can be defined as an abrupt transfer of control to the operating system. Exceptions are broadly classified into 3 main categories:
a. Interrupt: it is mainly caused due to I/O device.
b. Trap: It is caused by the program making a syscall.
c. Fault: It is accidentally caused by the program that is under execution such as( a divide by zero, or null pointer exception etc).
The processor’s fetch instruction unit makes a poll for the interrupts. If it finds something unusual happening in the machine operation it inserts an interrupt pseudo- instruction in the pipeline in place of the normal instruction. Then going through the pipeline it starts handling the interrupts. The operating system explicitly makes a transition from kernel mode to user mode, generally at the end of an interrupt handle pr kernel call by using a privileged instruction RFE( Return From Exception) instruction.
This solution is contributed by Namita Singh
Quiz of this Question
Attention reader! Don’t stop learning now. Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.
Learn all GATE CS concepts with Free Live Classes on our youtube channel.