Question: Write code to finish all the tasks listed in Assign2.asm. In Assign2.asm, an array a of n=11 integers are given at the beginning (make sure

Write code to finish all the tasks listed in Assign2.asm. In Assign2.asm, an array a of n=11 integers are given at the beginning (make sure do not change these integers): 43, -5, 11, 12, 64, -7, 14, 71, 70, 13, -27 The finished Assign2.asm should be filled with your MIPS code in the specified space to implement the given C code for Selection Sort: for (int i=0; i a[j]{ int temp = a[i]; a[i] = a[j]; a[j] = temp; } } }

.data Array: .word 43, -5, 11, 12, 64, -7, 14, 71, 70, 13, -27 string: .asciiz " "

# Tranfer the C code of selection sort to MIPS code. Do not modify the existing code and structure!

.text main: la $t0, Array li $t1, 0 li $t7,11 # array length n=11 mul $t7, $t7, 4 # 4*n subi $t8, $t7, 4 # 4*(n-1)

OuterLoop: add $t2, $t1, 4 # i is in $t1 and j is in $t2 # write your code here for Selection Sort # write your code here to print the sorted array/result

# exit addi $v0, $zero, 10 syscall

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!