Question: 1- Write a MIPS assembly program to initialize register $s0 to 8, register $s1 to 12, regis- ter $s2 to 5, and register $s3

1- Write a MIPS assembly program to initialize register $s0 to 8, 

1- Write a MIPS assembly program to initialize register $s0 to 8, register $s1 to 12, regis- ter $s2 to 5, and register $s3 to 2. Then, store register $s0 in the first element of an array, register $s1 in the second element of the array, register $s2 in the third element of the ar- ray, and register $s3 in the fourth element of the array. Then, sort the elements of the ar- ray using the selection sort algorithm, and display the sorted array. Please submit the source code and a screen shot showing your code works correctly. Note: The following is a part of selection sort program in C. for (c=0; c < (n - 1); c++) { } position = c; for (d = c + 1; d < n; d++) { if (array[position]> array[d]) position d; } if (position != c) { } swap = array[c]; array[c] = array[position]; array[position] = swap;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

data array space 16 Allocate space for 4 integers text globl main main Initialize registers li s0 8 ... View full answer

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 Programming Questions!