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.
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.
Solution :
#include
#include
#include
void interrupt (*oldint15) ( );
void interrupt newint15(unsigned int BP, …, flags);
void main ( )
{
oldint15 = getvect (0x15);
setvect (0x15, newint15);
keep (0, 1000);
}
{if (*(((char*)&AX) + 1) == 0x4F )
{
if (*((char*)&AX) == 0x2C)
*(((char*)&AX)) = 0x1E;
else if (*((char*)&AX) == 0x1E)
*((char*)&AX) = 0x2C;
}
else
(*oldint15)();
}
#include
#include
void interrupt (*oldint15) ( );
void interrupt newint15(unsigned int BP, …, flags);
void main ( )
{
oldint15 = getvect (0x15);
setvect (0x15, newint15);
keep (0, 1000);
}
{if (*(((char*)&AX) + 1) == 0x4F )
{
if (*((char*)&AX) == 0x2C)
*(((char*)&AX)) = 0x1E;
else if (*((char*)&AX) == 0x1E)
*((char*)&AX) = 0x2C;
}
else
(*oldint15)();
}