Suppose that a RISC machine uses 5 register windows. A) How deep can the procedu
ID: 3549039 • Letter: S
Question
Suppose that a RISC machine uses 5 register windows.
A) How deep can the procedure calls go before registers must be saved in memory? (That is, what is the maximum number of "active" procedure calls that can be made before we need to save any registers in memory?)
B) Suppose two more calls are made after the maximum value from part A) is reached. How many register windows must be saved to memory as a result?
C) Now suppose that the most recently called procedure returns. Explain what occurs.
D) Now suppose one more procedure is called. How many register windows need to be stored in memory?
Explanation / Answer
Suppose that a RISC machine uses 5 register windows.
a. How deep can the procedure calls go before registers must be saved in memory? (That is, what is the maximum number of "active'' procedure calls that can be made before we need to save any registers in memory?)
b. Suppose two more calls are made after the maximum value from part (a) is reached. How many register windows must be saved to memory as a result?
c. Now suppose that the most recently called procedure returns. Explain what occurs.
d. Now suppose one more procedure is called. How many register windows need to be stored in memory?
Ans. a. Due to the circular nature of the windows, the output registers of the last window are shared as the input registers of the first window. Therefore, only four procedures could be active without saving registers in memory.
b. The input registers from the first window, on the first call (due to wrap around), and the input, local, and output registers on the second call.
c. The previously saved registers are restored.
d. Again, the input, local, and output values would need to be saved.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.