Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. ;not done yet, so so far:
  2. ;This is a ti-83+ asm file
  3. #include "ti83plus.inc"
  4. .org userMem - 2
  5. .db t2ByteTok, tAsmCmp
  6. ;Program Here:
  7.  
  8. dispText:
  9. b_call(_ClrLCDFull)
  10. ld hl, (xpos)
  11. ld (penCol), hl
  12. ld hl, text
  13. b_call(_VPutS)
  14.  
  15. main:
  16. ; $BF is the group for the mode key
  17. ; so then to check for a quit, check the 7'th bit of the data for 0
  18. ld a, $FF
  19. out (1), a
  20. ld a, $BF
  21. out (1), a
  22. nop
  23. nop
  24. in a, (1)
  25. bit 7, a
  26. jr nz, check
  27. ret
  28.  
  29. check:
  30. ; now we do group $FE to check arrow keys
  31. ld a, $FF
  32. out (1), a
  33. ld a, $FE
  34. out (1), a
  35. nop
  36. nop
  37. in a, (1)
  38. bit 0, a
  39. jp z, down
  40. bit 1, a
  41. jp z, left
  42. bit 2, a
  43. jp z, right
  44. bit 3, a
  45. jp z, up
  46.  
  47. jp main
  48.  
  49. down:
  50. call mDown ; this is why we came here, no?
  51. bit 1, a
  52. call z, mLeft ; just to check if left + down have been pressed
  53. bit 2, a
  54. call z, mRight ; just to check if right + down have been pressed
  55. jp dispText
  56.  
  57. left:
  58. call mLeft
  59. bit 3, a
  60. call z, mUp
  61. jp dispText
  62. right:
  63. ; already checked for down and left
  64. call mRight
  65. bit 3, a
  66. call z, mUp
  67. jp dispText
  68. up:
  69. call mUp
  70. jp dispText
  71.  
  72. mDown:
  73.  
  74. ret
  75. mLeft:
  76.  
  77. ret
  78. mRight:
  79.  
  80. ret
  81. mUp:
  82.  
  83. ret
  84.  
  85. xpos:
  86. .db 0
  87. ypos:
  88. .db 0
  89. text:
  90. .db "Hello ASM.", 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement