CODE alloc 7 move 0, _5 move _5, _3 4: ; Top of the while loop move _3, _6 ; moving done move 0, _5 ceq _6, _5, _1 beq 0, _1, 5 ; Branch to the end of the while loop ; Start of the loop body print "Enter a number (0 to quit) : " inp _2 move _2, _5 ; moving i move 0, _4 ceq _5, _4, _1 beq 1, _1, 6 ; Fall through to the else part print "fib(" move _2, _4 ; moving i outp _4 print ") = " ; Start of parameter 0 move _2, _4 ; moving i param _4 call fib, 1 move _0, _4 move _4, _2 move _2, _4 ; moving i outp _4 print "\n" goto 7 ; Jump over then part 6: ; Start of then part move 1, _4 move _4, _3 7: ; End of if statement goto 4 ; Jump to the top of the while loop 5: ; End of the while loop free 7 exit PROCBEGIN fib alloc 5 move %0, %4 ; moving n move 1, %3 ceq %4, %3, _1 beq 1, _1, 0 ; Fall through to the else part move %0, %4 ; moving n move 2, %3 ceq %4, %3, _1 beq 1, _1, 1 ; Fall through to the else part ; Start of parameter 0 move %0, %4 ; moving n move 1, %3 sub %4, %3, %3 param %3 call fib, 1 move _0, %4 ; Start of parameter 0 move %0, %5 ; moving n move 2, %3 sub %5, %3, %3 param %3 call fib, 1 move _0, %3 add %4, %3, %3 move %3, _0 goto 2 ; Jump over then part 1: ; Start of then part move 1, %3 move %3, _0 2: ; End of if statement goto 3 ; Jump over then part 0: ; Start of then part move 1, %3 move %3, _0 3: ; End of if statement free 5 PROCEND