Question: Write a MIPS assembly language program that calls a procedure, Add_Sub_Mul, which accept four parameters (g,h,i,j) and returns, f = (g+h) if i >j; f=
Write a MIPS assembly language program that calls a procedure, Add_Sub_Mul, which accept four parameters (g,h,i,j) and returns,
f = (g+h) if i >j; f= (g-h) if i

Consider the variables g, h, i, j and f are initialized with some initial values in the data segment. Use $s0 as f in the function and also use $s0 to store the base address of f in the memory location. Clearly comment on the every instruction you use in your program. Specially, clearly show and describe the stack operation. Remember, resisters ($a0-$a2) are used for passing arguments in to the function and $v resisters are used to store the results in the function.
int Add Sum Mul (int g, int h, int i, int i) int f; if (i>j) f (g+h);3 else if (i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
