Question: Exercise 6 . 1 8 Consider the RISC - V assembly code below. func 1 , func 2 , and func 3 are nonleaf functions.
Exercise Consider the RISCV assembly code below. func func and func are nonleaf functions. func is a leaf function. The code is not shown for each function, but the comments indicate which registers are used within each function. You may assume that the functions do not need to save any nonpreserved registers on their stacks.
x func: func uses tt ss
x jal func
x func: func uses aa ss
x jal func
x func: func uses t ss
x jal func
x func: func uses ss
x jr ra
a How many words are the stack frames of each function?
b Sketch the stack after func is called. Clearly indicate which registers are stored where on the stack and mark each of the stack frames. Give values where possible. Assume that ABC just before func is called.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
