What are the contents (values of all five elements) of array v right before the jal sort
Question:
What are the contents (values of all five elements) of array v right before the “jal sort” instruction in the main code is executed?
The remaining three problems in this exercise refer to a program that allocates memory for an array, ills the array with some numbers, calls the sort function from Figure 2.27, and then prints out the array. The main function of the program is as follows (given as both C and MIPS code):
The my_alloc function is defined as follows (given as both C and MIPS code). Note that the programmer of this function has fallen prey to the pitfall of using a pointer to an automatic variable arr outside the function in which it is defined.
Figure 2.27
Step by Step Answer:
Computer Organization And Design The Hardware Software Interface
ISBN: 9780123747501
4th Revised Edition
Authors: David A. Patterson, John L. Hennessy