# 2 int add_em(int a, int b, int c, float y, float z) add_em: # 4 return a+b+c+y+z; addu $t6, $a0, $a1 # Add a and b into addu $t7, $t6, $a2 # Add on c mtc1 $t7,$f4 # Move a+b+c to the co-pro cvt.s.w $f6, $f4 # Convert to float add.s $f10, $f6, $f12 # Add a+b+c+y add.s $f18, $f10, $f13 # Add (a+b+c+y)+z cvt.w.s $f4, $f18 # Convert it back to an int (ret val is int) mfc1 $v0, $f4 # Move result to v0 j $ra # Return to caller # 7 void main(void) main: subu $sp, 48 sw $ra, 36($sp) # 9 int a; # 10 a=add_em(1,2,3,10.0,11.0); li $a0, 1 # Setup arguments to function li $a1, 2 li $a2, 3 li.s $f12, 1.0000000000000000e+01# Put the 4th arg in f12 (1st fp arg) li.s $f13, 1.1000000000000000e+01 jal add_em sw $v0, 44($sp) # Store result into a lw $ra, 36($sp) # Retore ra into caller addu $sp, 48 # Restore stack j $ra # Return to caller