Question: I need this done step by step please File Edit Run Settings Tools Help Run speed at max (no interaction) D101 1 Edit Execute Registers

I need this done step by step please

I need this done step by step please File Edit Run SettingsTools Help Run speed at max (no interaction) D101 1 Edit ExecuteRegisters Coproc 1 Coproco Number Value IP1.part2.asm 49 200.000.000 0:00:00 50 51

File Edit Run Settings Tools Help Run speed at max (no interaction) D101 1 Edit Execute Registers Coproc 1 Coproco Number Value IP1.part2.asm 49 200.000.000 0:00:00 50 51 *************** ******** 52 INITTALTZE I and 53 addi $81, Szero, 2 # Value for i, should be set to any valid index 54 addi $52, Szero, 5 # Value for should be set to any valid index s2, 5 j 55 80000000******* WARNANNA...00000*********** #proppy 200.000.000 56 57 ********* ####### 5B PRINT ARRAY 59 addi ssp. ssp. -12 60 sw $a0, (Ssp) 61 sw $al, 4($sp) 62 SW $ra, (ssp) 63 add $a0, $50, Szero # First argument - starting address of array 64 add $al, ss5, Szero # Second argument - Size 65 jal print call print routine. 66 lw $ra, 8(Ssp) 67 lw $al, 4($sp) 68 lw $a, @ssp) 69 addi $sp,$sp, 12 0.0.0.0.0.0.0.0 71 72 1; ################### 73 PUT SWAP CODE HERE 74 75 76 6666440000000000% **** 77 78 ***WWWWWW + ******** 79 #PRINT ARRAY 80 addi ssp. ssp. -12 81 sw $a0, 0(Ssp) B2 sw $a1, 4(ssp) 83 sw $ra, 8(ssp) B4 add $a0, $se, Szero # First argument - starting address of array B5 add $al, $85, Szero # Second argument - size 86 jal print o call print routine. 87 lw $ra, 8(Ssp) BB lw $al, 4issp) 89 lw $ae, Olssp) 90 addi $sp,$sp, 12 Name $zero Sat $v $v1 $a $al $a2 $a 3 $t $t1 $t2 $t3 $t4 $15 $t6 $t7 $s $51 $52 $s3 $54 $55 $56 $57 $18 $t9 sk $k1 $9p $SP $fp Sra PC hi Lo 1 Z 3 4 4 5 6 7 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 @x60400aaa 0x00000000 Ox0000GGGG 0x00000000 Gx00000000 x @x99999999 GXDOGGGGGG Oxaaaaaaaa 0x00000000 Ox0GGGGGGG 8x80000000 8x88888888 Oxaggagaga 0x00000000 GXGGGGGGGG 0x00000000 Ox00000000 Ox000000GB 8x80000000 Gx00000000 Oxaggggga 0x00000000 Ux8GGGGGGG Oxananana Ox00000000 Ox0GGGGGGG 8x80099990 Ox10008000 @x711feftc Bx00000000 OxUGOGGGGG 0x0049988 Ox00000000 @x8GGGGGGG 7B Line: 74 Column: 1 Show Line Numbers : Mars Messages Run I/O File Edit Run Settings Tools Help Run speed at max (no interaction) D101 TILL 1 Edit Execute Registers Coproc 1 Coproco Number Value 00.00.00 111 tttttttttt 000000000 IP1.part2.asm* 1 2.000.000 2 DATA BLOCK 3 .data # STARTS AT: 8x18818888 4 nus: .word 0 : 12 # "array" of 12 words to contain valves 5 size: .ward 12 # x79979999 # @x78070909 + 48 (124) ( 6 Space:.asciiz # 8x18818909 + 52 (4 more) 7 7 head: .asciiz " Array " # 8x78978999 + 54 (2 more) 8 .text 9 Pee************* 10 11 1000W 12 # LOAD MEMORY ADDRESSES 13 lui $t0, 6x1001 # Start of data section 14 ari $s@, Sto, D # Array is the first piece of data ( away) 15 lui $t0, 6x1001 # # Start of data section 16 ori $t0, sto, 48 # 12 elements * 4 17 lw $55, Biste) * load value of size 18 # AT THIS POINT: 19 # $58 is the address of the start of the array 20 # $55 is the size (22) 21 ********************************* 22 23000WWWWWWW 24 POPULATE ARRAY # 25 addi $t1, Szero, 55 26 sw $t1, B(SSB) 27 addi $t1, Szero, 88 2B sw $t1, 4(5) 29 addi stl, Szero, 30 sw $t1, 8(558) 31 addi $t1, szero, 22 32 sw $t1, 12(SSB) 33 addi $t1, Szero, 77 34 sw $t1, 16(sse) 35 addi $t1, Szero, 44 36 sw $t1, 20(80) 37 addi $t1, szero, 99 38 sw $t1, 24(sse) 39 addi $t1, Szero, 33 40 sw $t1, 28(5) 41 addi $t1, Szero, 110 42 sw $t1, 32(550) Name $zero Sat $v $v1 $a sal $ $a2 $a3 $t $t1 $t2 $t3 $t4 $15 $t6 $t7 $s $51 $52 $53 $54 $55 $56 $57 $18 $t9 $k $k1 $9p $SP $fp Sra PC hi Lo 1 Z 3 4 4 5 6 7 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 @x60400aaa 0x00000000 Ox0000GGGG 0x00000000 Gx00000000 x @x99999999 GXDOGGGGGG Oxaaaaaaaa 0x00000000 Ox0GGGGGGG 8x80000000 8x88888888 Oxaggagaga 0x00000000 GXGGGGGGGG 0x00000000 Ox00000000 Ox000000GB 8x80000000 Gx00000000 Oxaggggga 0x00000000 Ux8GGGGGGG Oxananana Ox00000000 Ox0GGGGGGG 8x80099990 Ox10008000 @x711feftc Bx00000000 OxUGOGGGGG 0x0049988 Ox00000000 @x8GGGGGGG ***eeeeee 000000000 Line: 74 Column: 1 Show Line Numbers Mars Messages Run I/O Swap Code Central to many sorting algorithms is the ability to swap array elements that are in the wrong order. Since we have not yet covered conditional (if) statements in MIPS and we would need that to check for ordering, we will for now just concern ourselves with swapping two elements i and j, i.e. in Java. Task: At the point in IP1.part2.asm marked PUT CODE HERE FOR SWAP, translate the following lines: int tmp = nums [i]; nums[i] = nums [j]; nums[j] = tmp; to MIPS. You can assume that the starting address of nums is in $50, i is in $51, and j is in $s2. Note: Your code should work for any i and j between 0 and 11. Some points to remember: 1. You will need another $s register for tmp. Remember do not use $50, $si, or $s2 - or you will overwrite nums, i, and j. Also do not use $s5, as that is the size. Remember: Variables in MIPS should always use $s registers. This is important, as I outlined in lecture - $t registers (being "temporary) can lose their contents if a function is called

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!