Geekboy

Untitled

Feb 11th, 2012
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;#######################################################################;
  2. ;       ___      ___   ___  __    ______   .___  ___.     ______.       ;
  3. ;      /   \     \  \ /  / |  |  /  __  \  |   \/   |    /      |       ;
  4. ;     /  ^  \     \  '  /  |  | |  |  |  | |  \  /  |   |   (---`       ;
  5. ;    /  /_\  \     >   <   |  | |  |  |  | |  |\/|  |    \   \          ;
  6. ;   /  _____  \   /  .  \  |  | |  `--'  | |  |  |  | .---)   |         ;
  7. ;  /__/     \__\ /__/ \__\ |__|  \______/  |__|  |__| |______/          ;
  8. ;                                                                       ;
  9. ;                The Assembly SDK for Axe programmers                   ;
  10. ;                         By Kevin Horowitz                             ;
  11. ;                       Last revision:  1.1.2                           ;
  12. ;                                                                       ;
  13. ;  This template will make it easy to implement real assembly commands  ;
  14. ;into Axe Parser so that they can be used just like the native commands ;
  15. ;that come with the App.                                                ;
  16. ;                                                                       ;
  17. ;#######################################################################;
  18.  
  19. ;###################
  20. ;#  Library header #
  21. ;###################
  22.  
  23. ;You should include "Axe.inc" in your axiom because it contains a lot of useful
  24. ;definitions to aid in Axiom development.  If you're using token replacements,
  25. ;you should also include "TokenHook.inc".
  26. #include "ti83plus.inc"
  27. #include "Axe.inc"
  28. #include "TokenHook.inc"
  29.  
  30. Cn2_Setup         equ $4209
  31. Cn2_Clear_SendBuf     equ $420C
  32. Cn2_Clear_RecBuf      equ $420F
  33. Cn2_Setdown       equ $4212
  34. Cn2_GetK         equ $4221
  35.  
  36. ;All Axioms must start with $DE,$C0:
  37. .dw $C0DE
  38.  
  39. ;1 CnOn is init calcnet
  40.  
  41. .dw initend          ;lable to thinger that states its the end
  42. .db %00001000
  43. .db t2ByteTok, tNormalPDF  ;tok
  44. .db %00000000
  45. .db 0       ;arguments
  46.  
  47.  
  48. .org $0000
  49. call cn2_setup
  50. initend:
  51. ;2
  52.  
  53. ;1 CnOff takes it down
  54. .dw teardown          ;lable to thinger that states its the end
  55. .db %00001000
  56. .db t2ByteTok, tDNormal  ;tok
  57. .db %00000000         ; uses r
  58. .db 0       ;arguments
  59. .org $0000
  60. call cn2_setdown
  61. teardown:
  62. ;2
  63.  
  64. ;1 CnONr sets it up and moves stuff around in memory
  65. .dw moveitlikeaboss          ;lable to thinger that states its the end
  66. .db %00001000
  67. .db t2ByteTok, tNormalPDF  ;tok
  68. .db %00000010         ; uses r
  69. .db 0       ;arguments
  70. .org $0000
  71. moveitlikeaboss:
  72. ;2
  73.  
  74. ;========== General purpose commands
  75. ;1 RecvF(0/1) sets recieve buffer flag to 0/1
  76. .dw recvframeprocessed          ;lable to thinger that states its the end
  77. .db %00001000
  78. .db t2ByteTok, tInvNorm ;tok
  79. .db %00000000         ; uses r
  80. .db 1       ;arguments
  81. .org $0000
  82.  ld de,($86f8) ; load de with sizeword thinger
  83.  bit 0,l     ;
  84.  jp nz,_      ; set it else
  85.  res 7,d     ; reset msb
  86.  jp ++_
  87. _:
  88.  set 7,d
  89. _:
  90.  ld ($86f8),de
  91.  recvtframeprocessed:
  92. ;2
  93.  
  94. ;1 RecvFR          returns the size of the recived frame
  95. .dw recvframesize         ;lable to thinger that states its the end
  96. .db %00001000
  97. .db t2ByteTok, tInvNorm  ;tok
  98. .db %00000010         ; uses r
  99. .db 0
  100. .org 0
  101.  ld hl,$86f8
  102.  ld h,0
  103. recvframesize:
  104. ;2
  105.  
  106. ;1 RecvFRR         returns a pointer to the adress of the id
  107. .dw recvframeid         ;lable to thinger that states its the end
  108. .db %00001000
  109. .db t2ByteTok, tInvNorm  ;tok
  110. .db %00000100         ; uses rr
  111. .db 0
  112. .org 0
  113.  ld hl,$86f3
  114. recvframeid:
  115. ;2
  116.  
  117. ;1 SendF(0/1)            ;sets the send buffer flag to 0/1
  118. .dw sendframeprocessed          ;lable to thinger that states its the end
  119. .db %00001000
  120. .db t2ByteTok,tTCDF  ;tok
  121. .db %00000000         ; uses r
  122. .db 1       ;arguments
  123. .org $0000
  124.  ld de,($87ff) ; load de with sizeword thinger
  125.  bit 0,l     ; if it is two
  126.  jp nz,_      ; set it else
  127.  res 7,d     ; reset msb
  128.  jp ++_
  129. _:
  130.  set 7,d
  131. _:
  132. ld ($87ff),de
  133. sendframeprocessed:
  134. ;2
  135.  
  136. ;1 SendF(lengthof data)r
  137.  
  138. .dw sizesend          ;lable to thinger that states its the end
  139. .db %00001000
  140. .db t2ByteTok, tTCDF  ;tok
  141. .db %00000010         ; uses r
  142. .db 1       ;arguments
  143. .org $0000
  144.  ld de,$87ff
  145.  ld h,$80
  146.  ex de,hl
  147.  ld (hl),de
  148. sizesend:
  149. ;2
  150.  
  151. ;1 SendF(ptr2ID)RR
  152. .dw sendframeid         ;lable to thinger that states its the end
  153. .db %00001000
  154. .db t2ByteTok, tTCDF ;tok
  155. .db %00000100         ; uses rr
  156. .db 1
  157. .org 0
  158.  ld de,$87fa
  159.  ld bc,5
  160.  ldir
  161. sendframeis:
  162. ;2
  163.  
  164. ;1 RBuff     returns a pointer to the recieve buffer
  165. .dw recvbufff         ;lable to thinger that states its the end
  166. .db %00001000
  167. .db t2ByteTok, tTPDF  ;tok
  168. .db %00000000
  169. .db 0
  170. .org 0
  171.  ld hl,86f8
  172. recvbufff:
  173.  
  174. ;2
  175.  
  176. ;1 RBuffR     clears the recive buffer
  177. .dw clearrbuff         ;lable to thinger that states its the end
  178. .db %00001001
  179. .db t2ByteTok,tTPDF  ;tok
  180. .db %00000010
  181. .db 0
  182. .org 0
  183.  ld de,86fb
  184.  ld hl,86fa
  185.  ld (hl),0
  186.  ld bc,255
  187.  ldir
  188. clearrbuff:
  189. ;2
  190.  
  191. ;1 SBuff    returns a pointer to the send buffer
  192. .dw sendbufff         ;lable to thinger that states its the end
  193. .db %00001000
  194. .db $BB,$1D  ;tok
  195. .db %00000000
  196. .db 0
  197. .org 0
  198.  ld hl,$8801
  199. sendbufff:
  200. ;2
  201.  
  202. ;1 SBuffR   clears the send buffer
  203. .dw clearsbuff         ;lable to thinger that states its the end
  204. .db %00001001
  205. .db $BB,$1D  ;tok
  206. .db %00000010
  207. .db 0
  208. .org 0
  209.  ld de,8802
  210.  ld hl,8801
  211.  ld (hl),0
  212.  ld bc,255
  213.  ldir
  214. clearsbuff:
  215. ;2
  216.  
  217. ;1 TokenHooks
  218. .dw hNormalPDF
  219. .db 4
  220. .db "CnOn"
  221.  
  222. .dw hDNormal
  223. .db 4
  224. .db "CnOn"
  225.  
  226. .dw hInvNorm
  227. .db 5
  228. .db "RecvF"
  229.  
  230.  
  231. .dw hInvT
  232. .db 7
  233. .db "TheGame"
  234.  
  235.  
  236. .dw hTPDF
  237. .db 5
  238. .db "RBuff"
  239.  
  240. .dw hTCDF
  241. .db 5
  242. .db "SendF"
  243.  
  244. .dw $BB1D
  245. .db 5
  246. .db "SBuff"
  247.  
  248. ;2
Advertisement
Add Comment
Please, Sign In to add comment