Question: MARS MIPS ARCHITECTURE - MIPS ASSEMBLY - ARRAYS Write a subprogram, called readArray, that asks the user the size of an integer array and initializes
MARS MIPS ARCHITECTURE - MIPS ASSEMBLY - ARRAYS
Write a subprogram, called readArray, that asks the user the size of an integer array and initializes the array entries with random numbers between 0 and 100. Returns the beginning address of the array in $a0, and array size in terms of number of integers in $a1. For random number generation see the related syscall, stackoverflow etc. Hint:
li $a0, 8 #enough space for two integers li $v0, 9 #syscall 9 (sbrk: allocate heap memory) syscall
# address of the allocated space is now in $v0. Make sure that you display the contents of the array with proper headings etc. For this write another subprogram.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
