Question: please explain part 3 The following MIPS assembly code contains a mistake that violates the MIPS convention in terms of using stack for storing protecting
please explain part 3

The following MIPS assembly code contains a mistake that violates the MIPS convention in terms of using stack for storing protecting registers. What is the mistake and how should it be fixed? Correct the corresponding lines in the code. For the corrected code, sketch the stack frame contents at the time when the instruction 'move $51, $al' is being executed. f: SW SW SW # Stack frame? addi $sp,$sp, 12 $ra, 8($sp) $51, 4($sp) $50, 0($sp) move $50, $ab move $51, $a1 jal 8 add $v0, $v0, $50 lw $ra, 8($sp) lw $51, 4($sp) lw $50, 0($sp) addi $sp,$sp, -12 jr $ra g: mul $v0, $50, $s1 $ra jr 3. Write C/Ch functions int f() and int g) implementing the MIPS code from Problem 2. Assume that in the MIPS code, $a0 and $al are the input integer parameters to the function f and that both f and g are passing their return values via $v0. The following MIPS assembly code contains a mistake that violates the MIPS convention in terms of using stack for storing protecting registers. What is the mistake and how should it be fixed? Correct the corresponding lines in the code. For the corrected code, sketch the stack frame contents at the time when the instruction 'move $51, $al' is being executed. f: SW SW SW # Stack frame? addi $sp,$sp, 12 $ra, 8($sp) $51, 4($sp) $50, 0($sp) move $50, $ab move $51, $a1 jal 8 add $v0, $v0, $50 lw $ra, 8($sp) lw $51, 4($sp) lw $50, 0($sp) addi $sp,$sp, -12 jr $ra g: mul $v0, $50, $s1 $ra jr 3. Write C/Ch functions int f() and int g) implementing the MIPS code from Problem 2. Assume that in the MIPS code, $a0 and $al are the input integer parameters to the function f and that both f and g are passing their return values via $v0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
