SHARE
TWEET

Untitled

a guest Nov 1st, 2018 154 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stk 64
  2. org 0
  3. ; var i
  4. mov r1,81
  5. mov r2,82
  6. sto r1,r2
  7. mov r1,87
  8. mov r2,5
  9. sto r1,r2
  10. ; var msg[5]
  11. mov r1,82
  12. mov r2,72
  13. sto r1,r2
  14. mov r1,83
  15. mov r2,101
  16. sto r1,r2
  17. mov r1,84
  18. mov r2,108
  19. sto r1,r2
  20. mov r1,85
  21. mov r2,108
  22. sto r1,r2
  23. mov r1,86
  24. mov r2,111
  25. sto r1,r2
  26. ; msg = "Hello"
  27. lbl 1
  28. ; while i < msg.size
  29. psh 0
  30. mov r1,81
  31. rcl r2,r1
  32. psh r2
  33. mov r1,80
  34. rcl r2,r1
  35. psh r2
  36. pop r1
  37. pop r2
  38. add r1, r2
  39. psh r1
  40. pop r1
  41. pop r2
  42. rcl r2, r1
  43. psh r2
  44. out r2
  45. ;   putchar 0$(msg + i)
  46. mov r1,80
  47. rcl r2,r1
  48. psh r2
  49. psh 1
  50. pop r1
  51. pop r2
  52. add r1, r2
  53. psh r1
  54. mov r1,80
  55. pop r2
  56. sto r1,r2
  57. ;   i += 1
  58. mov r1,80
  59. rcl r2,r1
  60. psh r2
  61. mov r1,87
  62. rcl r2,r1
  63. psh r2
  64. pop r1
  65. pop r2
  66. lt_ r2, r1
  67. psh r2
  68. pop r2
  69. jz_ r2,2
  70. jmp 1
  71. lbl 2
  72. ;
  73. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top