Question: Write a MIPS assembly code to perform the following task In this assignment, you will iteratively populate a fixed-size integer array of 10 elements, array_a,

Write a MIPS assembly code to perform the following task

In this assignment, you will iteratively populate a fixed-size integer array of 10 elements, array_a, with integer values provided by the user. The user will enter 10 positive integer values, one per line, and the program will store the 10 values in array_a[0], array_a[1], , array_a[9]. Once the 10 integers are entered, your program will print the array, then prompt the user for a search value which may or may not exist in the array. If the value exists, your program must print all locations where the value is stored. If the value does not exist in the array, it will display the message that value does not exist in the array!. After all, output has been displayed, the program should exit (do not prompt for additional input). Input will be entered by the user in the following form: Once all of the input is entered, output will be printed in the following format (where is one of the integers provided by the user): array_a[0] = array_a[1] = array_a[2] = array_a[3] = array_a[4] = array_a[5] = array_a[6] = array_a[7] = array_a[8] = array_a[9] = Next, the prompt for a search value will be given, and input will be accepted in the following form: ENTER A SEARCH VALUE: Which will then print all of the array indices containing that value, one per line, or the constant string that value does not exist in the array!. For example, output when the user enters {1, 1, 2, 3, 4, 5, 6, 1, 7, 8} for the array values and 1 for the search value should be displayed as follows: array_a[0] = 1 array_a[1] = 1 array_a[2] = 2 array_a[3] = 3 array_a[4] = 4 array_a[5] = 5 array_a[6] = 6 array_a[7] = 1 array_a[8] = 7 array_a[9] = 8 ENTER A SEARCH VALUE: 1 array_a[0] = 1 array_a[1] = 1 array_a[7] = 1 If the user instead were provide 99 for the search value, output should be displayed as follows: array_a[0] = 1 array_a[1] = 1 array_a[2] = 2 array_a[3] = 3 array_a[4] = 4 array_a[5] = 5 array_a[6] = 6 array_a[7] = 1 array_a[8] = 7 array_a[9] = 8 ENTER A SEARCH VALUE: 99 That value does not exist in the array!

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!