Question: The MIPS code fragment below tries to copy words from the address in register $a0 to the address in register $al, counting the number of

 The MIPS code fragment below tries to copy words from the

The MIPS code fragment below tries to copy words from the address in register $a0 to the address in register $al, counting the number of words copied in register vO. The code stops copying when it finds a word equal to O. You do not have to preserve the contents of registers $v1, a0, and a1. The terminating word should be copied but not counted. There are multiple bugs in this MIPS program; fix them and write a bug-free version. Make a list of the bugs found and explain them.Use the MARS MIPS Simulator to verify the correct functionality of your program. Capture and attach the screen output that proves the correct operation 7. #initialize count #read next word from source #write to destination #advance pointer to next source #advance pointer to next destination addi $v0, ero, 0 loop: lw $v1, 0 ($a0) sw $v1, 0($al) addi $a0, $a0, 4 addi $a1, $a1, 4 beq $v1, $,zero, loop #loop if word copied != zero The MIPS code fragment below tries to copy words from the address in register $a0 to the address in register $al, counting the number of words copied in register vO. The code stops copying when it finds a word equal to O. You do not have to preserve the contents of registers $v1, a0, and a1. The terminating word should be copied but not counted. There are multiple bugs in this MIPS program; fix them and write a bug-free version. Make a list of the bugs found and explain them.Use the MARS MIPS Simulator to verify the correct functionality of your program. Capture and attach the screen output that proves the correct operation 7. #initialize count #read next word from source #write to destination #advance pointer to next source #advance pointer to next destination addi $v0, ero, 0 loop: lw $v1, 0 ($a0) sw $v1, 0($al) addi $a0, $a0, 4 addi $a1, $a1, 4 beq $v1, $,zero, loop #loop if word copied != zero

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!