Factorial in MIPS (Assumptions)
The argument (n) is in $4
$11 holds the value 1
$8 is already initialised to 1
$8 will hold the result
We will use the pretend instructions
push
pop
print
for sake of simplicity.
Previous slide
Next slide
Back to first slide
View graphic version