Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

main: la $sp, stack *******************! load address of stack label into $sp la

ID: 3549373 • Letter: M

Question

main: la $sp, stack *******************! load address of stack label into $sp

la $at, factorial *******************! load address of factorial label into $at

addi $a0, $zero, 4 *******************! $a0 = 4, the number to factorialize

jalr $at, $ra **************************************! jump to factorial, set $ra to return addr

halt **************************************! when we return, just halt


factorial: halt *******************! change me to your factorial implementation


stack: .byte 0 **************************************! the stack begins here (for example, that is)

Explanation / Answer

main: la $sp, stack *******************! load address of stack label into $sp la