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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started