Question: Assignment Write RISC-V assembly code for bubble sort (without function calling). Assume that arr[5] ={6,1,3,2,7}; starting at memory address 010000000. Pseudocode for bubble sort procedure

Assignment Write RISC-V assembly code for bubble sort (without function calling). Assume that arr[5] ={6,1,3,2,7}; starting at memory address 010000000. Pseudocode for bubble sort procedure bubblesort( list : array of items) loop = list.count ; for i=0 to 100p1 do: swapped = false for j=0 to loop-1 do: / compare the adjacent elements / if list [j] > list [j+1] then /* swap them */ swap( list[j], list[j+1] ) swapped = true end if end for / if no number was swapped that means array is sorted now, break the loop.*/ if(not swapped) then break end if end for end procedure return list Note that you will have to write 2 loops Copy this starter code and continue writing your code in your .5 file: # arr ={6,1,3,2,7} LI a0, 0x10000000 \# start address II a 2,6 SB a2,0(a0) II a2,1 SE a2,4(a0) II a2,3 SB a 2,8(a0) LI a2,2 SB a2, 12(a0) LI a2,7 SB a2,16(a0) \# BEGIN YOUR CODE HERE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
