(Solved) : Mips Instruction Set Machine Language Convert Following High Level Language Mips Instructi Q37177319 . . .
MIPS Instruction Set- MachineLanguage
Convert the following high-levellanguage into MIPS instructions. Please write comments for eachinstructions. Assume a, b, c, d are associated with registers $s0,$s1, $s2, $s3, respectively.
void main ()
{
int a = 10, b = 20;
int c = add(a, b);
int d = sub(a, b);
swap (a, b);
}
int add( int var1, int var2)
{ return (var1 + var2); }
int sub(int var1, int var2)
{ return (var1 – var2); }
void swap(int var1, int var2)
{
int tmp = var1;
var1 = var2;
var2 = tmp;
}
Expert Answer
Answer to MIPS Instruction Set- Machine Language Convert the following high-level language into MIPS instructions. Please write co…
OR