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
.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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started