Question: A callable nested function add _ memory _ values as shown below calls another function ( plot _ function with parameter a 0 ) and

A callable nested function add_memory_values as shown below calls another function (plot_function with parameter a0) and being a nested function, it also gets called from somewhere. We assume that the code that follows uses the RISC-V calling conventions. We also assume that the function knows essentially nothing about its caller, nor about the function that it calls, i.e. plot_numbers (that is other than knowing what parameters are passed returned. Assume that mvs1,s2 is the pseudo instruction equivalent of: addi $1,$2,0, in other words, it copies register 52 to $1.
add_memory_values: adds and plots numbers in array of integers
# SAVE REG_SET1 ON STACK CODE GOES
HERE
mvs1,a0 # param with address of array of integers
mvs2,a1 # parameter with number of integers to be added
# s2 will be used as a down
counter
li t2,0, # initializes an accumulator
loop1:
Iwu t1, O(s1) # load from integer array
add s1,4 # go to to next word for each time around loop
 A callable nested function add_memory_values as shown below calls another function

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!