ps6pr4.txt - ps6pr4(Problem Set 6 Problem 4 The Fibonacci...

This preview shows page 1 out of 1 page.

# # ps6pr4.txt (Problem Set 6, Problem 4) # # The Fibonacci sequence # # # ps6pr4.txt (Problem Set 6, Problem 4) # # The Fibonacci sequence # 00 read r1 # place user input in register r1 01 addn r1 -2 # add integer -2 to register r1 02 setn r2 1 # Set r2 =1 03 write r2 # print r2 04 copy r3 r2 # let r3 = r2 05 write r3 # print r3 06 add r4 r3 r2 # Set r4 =r3+r2 07 nop 08 jeqzn r1 15 # if r1==0, then jump to line 15 09 nop 10 call r14 18 # Copy the next address into r14 and then jump to line 18 11 jumpn 08

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture