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
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