Advertisement
Guest User

Untitled

a guest
Feb 6th, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. void io_write(__reg("r0") short, __reg("r1") short) =
  2. "\tmov\tA, r0\n"
  3. "\tmov\tX, A\n"
  4. "\tmov\tA, r1\n"
  5. "\tiowr\tA, [X]\n"
  6. "1:\n"
  7. "\tcc\tior\n"
  8. "\tb.nz\t1b\n"
  9. "\tnop\n";
  10.  
  11. static void
  12. clear_screen(void)
  13. {
  14. short io_ptr = 0x8000;
  15. int n = 16384;
  16. do {
  17. io_write(io_ptr, 0);
  18. io_ptr++;
  19. } while (--n);
  20. }
  21.  
  22.  
  23. .text
  24. l1:
  25. mov A, X
  26. std A, [Y--]
  27. mov A, r8
  28. std A, [Y--]
  29. mov A, r9
  30. std A, [Y--]
  31. imm $128
  32. mov A, $0
  33. mov r8, A
  34. imm $64
  35. mov A, $0
  36. mov r9, A
  37. l8:
  38. mov A, r8
  39. mov r0, A
  40. mov A, $0
  41. mov r1, A
  42. mov A, r0
  43. mov X, A
  44. mov A, r1
  45. iowr A, [X]
  46. 1:
  47. cc ior
  48. b.nz 1b
  49. nop
  50.  
  51. inc r8, r8
  52. dec r9, r9
  53. imm $hi(l8)
  54. ba.nz $lo(l8)
  55. nop
  56. ldd A, [Y++, $1]
  57. mov r9, A
  58. ldd A, [Y++, $1]
  59. mov r8, A
  60. ldd A, [Y++, $1]
  61. mov X, A
  62. bax
  63. mov A, $0
  64.  
  65.  
  66. .text
  67. _entry:
  68. mov A, X
  69. std A, [Y--]
  70. imm $(hi(l1))
  71. bal $(lo(l1))
  72. nop
  73. ldd A, [Y++, $1]
  74. mov X, A
  75. bax
  76. mov A, $0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement