Posts: 323
Threads: 241
Joined: Oct 2012
CS609 System Programming Assignment No. 01 Solution and Discussion
Question 1: Marks 10
Answer the following questions precisely. Do not include irrelevant data in your answers. Any answer with more than three lines will neglect your marks. (2 marks for each)
Q1. Where are the interrupt vectors located in the microprocessors memory?
Q2. Which interrupt vectors are reserved by Intel?
Q3. Explain the operation of IRET instruction.
Q4. List the events that occur when an interrupt becomes active.
Q5. Explain the purpose of the trap flag (TF).
Question 2: Marks 10
Write a C program that should write the value of 'z' in the keyboard buffer whenever the letter 'a' is pressed from keyboard.
Posts: 9,583
Threads: 8,089
Joined: Apr 2011
Explain the operation of IRET instruction.?
In Real Address Mode, iret pops CS, the flags register, and the instruction pointer from the stack and resumes the routine that was interrupted. In Protected Mode, the setting of the nested task flag (NT) determines the action of iret. The IOPL flag register bits are changed when CPL equals 0 and the new flag image is popped from the stack.
iret returns from an interrupt procedure without a task switch if NT equals 0. Returned code must be equally or less privileged than the interrupt routine as indicated CS selector virtualian.ning.com RPL bits popped from the stack virtualian.ning.com. If the returned code is less privileged, iret pops SS and the stack pointer from the stack