[solved]-Translate Following C Program Mips Assembly Program Explain Instruction Int Main Const Int Q39013596
Translate the following C++ program to MIPS assembly programexplain each instruction
int main() { const int SIZE = 6; int values[SIZE] = {5, 7, 2, 8,9, 1}; cout << “The unsorted values aren”; showArray(values,SIZE); selectionSort(values, SIZE); cout << “The sortedvalues aren”; showArray(values, SIZE); return 0; } voidselectionSort(int array[], int size) { int startScan, minIndex,minValue; for (startScan = 0; startScan < (size − 1);startScan++) { minIndex = startScan; minValue = array[startScan];for(int index = startScan + 1; index < size; index++) { if(array[index] < minValue) { minValue = array[index]; minIndex =index; } } array[minIndex] = array[startScan]; array[startScan] =minValue; } } void showArray(const int array[], int size) { for(int count = 0; count < size; count++) cout <<array[count] << ” “; cout << endl; }
Expert Answer
Answer to Translate the following C++ program to MIPS assembly program explain each instruction int main() { const int SIZE = 6; i… . . .
OR

