Question: Using MIPS Assembly Language please The purpose of this program is to help you understand dynamic array, system stack and multi- level subprogram calls This
Using MIPS Assembly Language please



The purpose of this program is to help you understand dynamic array, system stack and multi- level subprogram calls This program will first prompt user to input a valid array size (between 4 inclusive to 11 exclusive) and then dynamically allocate an array in memory based on the size. It will then ask user to input integers one by one to fill out the allocated array until it's full. After input, the program will print out the original array and then do three operations on the array: 1 calculate the summation of all even numbers in the array and print out the result; 2. dynamically allocate a new array with the same size, reversely copy all elements from the original array in to the new array, and then print the new array to the console; 3. Prompt user for a stride n and print out every nh element in the new reversed array. To achieve this goal, you will need 1 main program associate with 7 subprograms: This subprogram will have no argument IN and two arguments OUT: $spt0 array base address (OUT) $sp+4 - array size (OUT) create array will prompt user for a size of the array and will validate the input (between 4 inclusive to 11 exclusive). If an invalid size is entered, it will print arn error message and re-prompt the user for a valid one. When a valid size is entered, createarray will call allocate array to dynamically allocate an array And then it will call read array to fill it out. It will return base address and array size to the calling location at the end of this subprogram This subprogram will have one argument IN and one arguments OUT: $spt0 - user input size (IN) $spt4 - array base address (OUT) allocate .acray will dynamically allocate enough memory to hold the array based on the input size, and then return base address of the array back to the calling location 3 read array This subprogram will have two arguments IN and no argument OUT: $spt0 array base address (IN) $sp+4 - array size (IN) read aray will read integer values from user and store them into the array until the array is full. A prompt must be printed before each entry is read (e.g. "Enter an integer: ")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
