Purchase Solution

Bugs in program

Not what you're looking for?

Ask Custom Question

The following program tries to copy words from the address in register $a0 to the address in register $a1, counting the number of words copied in register $v0. The program stops copying when it finds a word equal to 0. You do not have to preserve the contents of registers $v1, $a0, and $a1. This terminating word should be copied but not counted.

addi $v0, $zero, 0 #Initialize count
loop: lw $v1, 0($a0) # Read next word from source
sw $v1, 0($a1) # write to destination

addi $a0, $a0, 4 # Advance pointer to next source
addi $a1, $a1, 4 # Advance pointer to next destination
beq $v1, $zero, loop #loop if word copied != zero

There are multiple bugs in this MIPS program; fix them and turn in a bug - free version.

and one more problem:
show the singele MIPS instruction or minimal sequence of instructions for this C statement:

b = 25 | a;
Anssume that a corresponds to register $t0 and b corresponds to register $t1.

Thank you for help

Purchase this Solution

Solution Summary

Bugs in program are assessed.

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Networking Questions

This quiz consists of some basic networking questions.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C# variables and classes

This quiz contains questions about C# classes and variables.