.data n: .word 9 # int n = 9 ; # register usage # $t0: fib(i) # $t1: fib(i+1) # $t2: temp # $t3: counter - from n down to zero .text main: add $t0, $0, $zero # initialize $t0 = 0 addi $t1, $zero, 1 # initialize $t1 = 1 la $t2, n # initialize $t2 = &n lw $t3, 0($t2) # dereference $t3 = *$t2 fib: beq $t3, $0, finish # while ($t3 != 0) { add $t2,$t1,$t0 # compute next fib move $t0, $t1 # set up for next iteration move $t1, $t2 subi $t3, $t3, 1 # decrement counter j fib # } finish: addi $a0, $t0, 0 li $v0, 1 # you will be asked about what the purpose of this line for syscall syscall li $v0, 10 syscall