A RISC machine has 62 registers out of which 8 registers are reserved for the Global variables and 24 for Instruction related tasks. This machine has been designed to have 6 registers for storing two input parameters, two output parameters and two local variables for function call. Explain with the help of a diagram, how the overlapped register window can be implemented in this machine for function/procedure calls. You must explain how the parameters will be passed when a function calls another function.



Q:-      A RISC machine has 62 registers out of which 8 registers are reserved for the Global variables and 24 for Instruction related tasks. This machine has been designed to have 6 registers for storing two input parameters, two output parameters and two local variables for the function call. Explain with the help of a diagram, how the overlapped register window can be implemented on this machine for function/procedure calls. You must explain how the parameters will be passed when a function calls another function?
answer:-     Assume that the number of incoming parameters is equal to the number of outgoing parameters. Therefore, Number of locals = 24 –(2 × Number of incoming parameters) Return address is also counted as a parameter, therefore, number of incoming parameters is more than or equal to 1 or in other terms the possible combination,


Comments