Translate the following program into MIPS assembly language
Translate the following program into MIPS assembly language. If you need to use registers $t0 through $t7, use the lower-numbered registers first. Your assembly implementation should exactly follow the code sequence given below. Do not perform any optimization at pseudo code level or at assembly level.
main() {
int n, m; weightedsum(n,m);
}
int weightedsum(int x, int y) {
return(sum(x,x) + y);
}
int sum(int a, int b){
return(a+b);
}
Solution
sum:
