Suppose that a RISC machine uses 5 register windows. a) How deep can the procedu
ID: 3537568 • 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?
Please show all work, or No points will be awarded. Thanks!
Explanation / Answer
a) Since, one window (set) of registers can be visible by one procedure execution environment at any time. And N-Window register files can save only N-1 active procedures.
Thus depth of 4 procedures calls are allowed in the RISC with 5 register windows.
b) Minimum two window registers need to be saved to memory, to store the new procedure calls.
c) Since most recently saved window pointer is maintained, when a most recently called procedure returns (means when a register window becomes free), the most recently saved register window is restored back from memory.
d) Since already 4 register windows are filled, one register window need to be saved in memory in order to save the newly called procedure
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.