Question: For the whole assignment, pseudo - instructions are not allowed except j target _ label and jr ra . One suggestion for

For the whole assignment, pseudo-instructions are not allowed except "j target_label" and "jr ra". One suggestion for assembly programming problems is that you can include comments to one or a block of instructions.
Section I: Problems
(30 Points) Write a RISC-V assembly function to search a specified integer in an integer array. The function should take the base address of the array, the number of elements in the array, and the specified integer as function arguments. The function should return the index number of the first array entry that holds the specified value. If no array element is the specified value, it should return the value -1.
(15 points) Consider a RISC-V assembly function func1. func1 has three passing arguments stored in registers a0,a1 and a2, uses temporary registers t0-t3 and saved registers s4-s10. func1 needs to call func2 and other functions may call func1 also. func2 has two passing arguments stored in registers a0 and a1, respectively. In func1, after the program returns to func1 from func2, the code needs the original values stored in registers t1 and a0 before it calls func 2.
(a) How many words are the stack frames of function func1?
(b) Indicate which registers are stored on the stack of func1.
 For the whole assignment, pseudo-instructions are not allowed except "j target_label"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!