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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started