Question

In: Computer Science

At the end of a service routine, suppose we have two RTI instructions one after another....

At the end of a service routine, suppose we have two RTI instructions one after another. Will something go wrong? Explain.

Solutions

Expert Solution

Yes, it will cause problem.

When a processor receives and interrupt, then it completes the execution of the current instruction (only the current). It then put the contents of the program counter in a stack and then attends the interrupt service routine/subroutine. At the end of the service routine, the return from interrupt (RTI) instruction resets all the flags and the interrupt function is terminated and the regular applications start the execution once again.

If there are two RTI instructions one after another, then the status registers will be restored twice from the stack. This method is generally performed using the pop () operation. So, the next content of the stack will be executed which can change the flow of execution of the current instruction. It can alter (reset) the status registers. In this way it can cause problems.

Please comment in case of any doubt.
Please upvote if this helps.


Related Solutions

3. In a typical service routine, to go back to the previous code we do RTI....
3. In a typical service routine, to go back to the previous code we do RTI. Suppose we replace RTI by a sequence of two instructions: POPpc POPpsw The POPpc instruction will pop the PC value from the control stack (assume that PC, PSW values are on the stack in the right order) and put it into the PC register. The POPpsw instruction will pop the PSW value from the control stack and put it in the PSW register. Assume...
Suppose a user wants to do a system call. Assume that the service routine of this...
Suppose a user wants to do a system call. Assume that the service routine of this system call is at physical address 500., instead of executing a system call, the user simply jumps to this location 500. Assume that logical and physical addresses are the same and no memory protection is in place, i.e., cpu does not check that this address 500 is beyond the user’s memory space. Will something go wrong while the service routine executes?
In polymer chemistry, Suppose we have two polypropylene samples.  One is atactic and one is isotactic. a)...
In polymer chemistry, Suppose we have two polypropylene samples.  One is atactic and one is isotactic. a) Explain the microstructural difference between the two; b) Would you expect the atactic sample to be stronger, weaker, or the same strength as the isotactic sample?  Explain.
The instructions for the given integral have two​ parts, one for the trapezoidal rule and one...
The instructions for the given integral have two​ parts, one for the trapezoidal rule and one for​ Simpson's rule. Complete the following parts. Integral from 0 to pi ∫4sint dt I. Using the trapezoidal rule complete the following. a. Estimate the integral with n=4 steps and find an upper bound for AbsoluteValueET. T=? ​(Simplify your answer. Round to four decimal places as​ needed.) An upper bound for AbsoluteValueET is ? ​(Round to four decimal places as​ needed.) b. Evaluate the...
Q1. If we decide to use two pairs of base-limit registers (one for Instructions, one for...
Q1. If we decide to use two pairs of base-limit registers (one for Instructions, one for data), what will be its advantages and disadvantages. Q2. Describe the mechanism where a segment could belong to the address spaces of two different processes. Q3. Consider a logical address space of 64 pages of 1,024 bytes each, mapped onto a physical memory of 32 frames. a. How many bits are there in the logical address? b. How many bits are there in the...
Identify two companies that have recently merged with one another.
Identify two companies that have recently merged with one another. Discuss how the merger went from both a positive as well as a negative perspective.
Suppose we have another revolution, and I am named as the benevolent dictator of the new...
Suppose we have another revolution, and I am named as the benevolent dictator of the new country (the US is now named the United States of the Chicago Cubs). Given this opportunity, I design a new economic system in which I own all physical and intellectual property, everyone else (citizens, permanent residents, and even temporary visitors) is provided a universal basic income of $40,000 per year, and I let people use my things (e.g., homes, cars, cell phones, etc.) if...
1. Barter system a) the exchange of one good or service for another good or service....
1. Barter system a) the exchange of one good or service for another good or service. b) coins, paper money and demand deposits in chartered banks. c) can be converted quickly into case. d) provides the lifeblood of the circular flow of income and expenditure.
Suppose that we have two bags each containing black and white balls. One bag contains two...
Suppose that we have two bags each containing black and white balls. One bag contains two times as many white balls as black balls. The other bag contains two times as many black balls as white. Suppose we choose one of these bags at random. For this bag we select five balls at random, replacing each ball after it has been selected. The result is that we find all balls are white balls. What is the probability that we were...
1. Suppose we have two sets of prediction for the inflation rate for next year: one...
1. Suppose we have two sets of prediction for the inflation rate for next year: one from a random sample of Fortune 500 firms and another from a random sample of university economists. At 0.05 level can it be claimed that on the average university educators are predicting a higher inflation rate for next year than the major private businesses? Fortune 500 Firms 4.3% 3.8% 6.0% 4.4% 5.1% 5.6% 4.2% 6.1% 4.5% 4.0% University Economists 4.4% 5.9% 7.0% 5.1% 5.9%...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT