Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Fibonacci numbers
- word a 0
- word b 1
- word c
- word d 0
- word e 13
- word f 0
- load r0 e
- load r4 f
- load r2 f
- load r1 a // r1 = a
- load r2 b // r2 = b
- Loop: load r3 d // r3 = 0
- add r3 r1 r2 // r3 = r1 + r2
- store r2 f // saves the value in r2 to f
- store r3 c
- load r1 f // fetches the value in f and saves it in r1
- load r2 c
- addc r4 1 //i++
- jumpn r4 Loop // if r4 != 13 then loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement