Question: Please help me write a factorial in MIPS Assembly. The pseudocode looks like: factorial(i) { int num = 1; for (int i = 1; i

Please help me write a factorial in MIPS Assembly.

The pseudocode looks like:

factorial(i) {

int num = 1;

for (int i = 1; i <= n; i++) {

num *= 1

}

return num

}

This is a method that I will use inside another method. n is stored in register $s0, i is stored in register $s1. Register $s2 is already storing another variable in another method. How would I make this method in MIPS? Please explain the steps.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!