Advertisement
Guest User

Untitled

a guest
Feb 17th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. //Fibonacci numbers
  2.  
  3. word a 0
  4. word b 1
  5. word c
  6. word d 0
  7.  
  8. word e 13
  9. word f 0
  10.  
  11. load r0 e
  12. load r4 f
  13. load r2 f
  14.  
  15.  
  16.  
  17. load r1 a // r1 = a
  18. load r2 b // r2 = b
  19. Loop: load r3 d // r3 = 0
  20. add r3 r1 r2 // r3 = r1 + r2
  21. store r2 f // saves the value in r2 to f
  22. store r3 c
  23. load r1 f // fetches the value in f and saves it in r1
  24. load r2 c
  25. addc r4 1 //i++
  26. jumpn r4 Loop // if r4 != 13 then loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement