
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Write MIPS code that a compiler could generate for the program below. You might want to write the code for the main program before that of the function.
#include <stdio.h>
int power(int x, int y) { if (y == 1) return x; else return x * power(x, y - 1); }
int main() { printf("%d\n", power(2, 5)); printf("%d\n", power(3, 4)); printf("%d\n", power(1, 8)); return 0; }