Question: Creathe a program in MIPS. Reserve space in memory for three variables called var1 through var3 of size word. The initial values of var1 and

Creathe a program in MIPS.

Reserve space in memory for three variables called var1 through var3 of size word. The initial values of var1 and var2 will be 4 and 5 respectvely. Var3 will be initialized to minus the number of this year.

The program will implement the piece of C code described below. tmp is a local variable for which you may use any of the registers $t0 through $t9. Use only branches found in the native instruction set.

if (var1 == var2) {

var1 = var3; /* change the values of var1 and .. */

var2 = var3; /* var2 to the value of var3 */

} else { /* execute when var1 != var2 */

tmp = var1; /* swap the values of var1 and var2 */

var1 = var2;

var2 = tmp;

}

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!