Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. [section __code]
  2. iter:
  3. ; checkinng loop condition
  4. push *0x0
  5. cmp0
  6. and2
  7. rsh2
  8.  
  9. jez end
  10.  
  11. ; a, b = b + a, b
  12. swp
  13. dpl
  14. sav *0x5
  15. pop
  16. dpl
  17. push *0x5
  18. add
  19.  
  20. push 0x1
  21. push *0x0
  22.  
  23. sub
  24. sav *0x0
  25.  
  26. jmp iter
  27.  
  28. __start:
  29. push #n
  30. wrt
  31.  
  32. brp
  33.  
  34. ; reading N from constants
  35. ; sub 1 from N for loop condition
  36. push 0x1
  37. push #0x0
  38.  
  39. ; write number to console
  40. dpl
  41. wrt
  42.  
  43. sub
  44.  
  45. sav *0x0
  46.  
  47. push 0x0
  48. push 0x1
  49.  
  50. ; start loop
  51. jmp iter
  52.  
  53. end:
  54. ; write top value from stack
  55. wrt
  56.  
  57. [section __data]
  58. resb 20
  59.  
  60. [section __constants]
  61. n:
  62. db 0x10, 0x0, 0x0, 0x0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement