Geekboy

Untitled

Feb 11th, 2012
137
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. #define B_CALL(xxxx) rst 28h \ .dw xxxx
  31. Cn2_Setup         equ $4209
  32. Cn2_Clear_SendBuf     equ $420C
  33. Cn2_Clear_RecBuf      equ $420F
  34. Cn2_Setdown       equ $4212
  35. Cn2_GetK         equ $4221
  36.  
  37. ;All Axioms must start with $DE,$C0:
  38. .dw $C0DE
  39.  
  40.  
  41. ;####################
  42. ;#  Command Fields  #
  43. ;####################
  44. ; no args
  45. ;(normalpdf())
  46. ;1 CnOn is init calcnet
  47.  
  48. .dw initend          ;lable to thinger that states its the end
  49. .db %00001000
  50. .db t2ByteTok, tNormalPDF  ;tok
  51. .db %00000000
  52. .db 0       ;arguments
  53. ;will originally only use 2 third one is for the inevitable UID handler
  54.  
  55. .org $0000
  56. call cn2_setup
  57. initend:
  58. ;2
  59.  
  60. ;1 CnOff takes it down
  61. .dw teardown          ;lable to thinger that states its the end
  62. .db %00001000
  63. .db t2ByteTok, tDNormal  ;tok
  64. .db %00000000         ; uses r
  65. .db 0       ;arguments
  66. ;will originally only use 2 third one is for the inevitable UID handler
  67. .org $0000
  68. call cn2_setdown
  69. teardown:
  70. ;2
  71.  
  72. ;1 CnONr sets it up and moves stuff around in memory
  73. .dw moveitlikeaboss          ;lable to thinger that states its the end
  74. .db %00001000
  75. .db t2ByteTok, tNormalPDF  ;tok
  76. .db %00000010         ; uses r
  77. .db 0       ;arguments
  78. ;will originally only use 2 third one is for the inevitable UID handler
  79. .org $0000
  80. moveitlikeaboss:
  81. ;2
  82.  
  83. ;========== General purpost commands
  84. ;1 RecvF(0/1) sets recieve buffer flag to 0/1
  85. .dw recvframeprocessed          ;lable to thinger that states its the end
  86. .db %00001000
  87. .db t2ByteTok, tDNormal  ;tok
  88. .db %00000000         ; uses r
  89. .db 1       ;arguments
  90. ;will originally only use 2 third one is for the inevitable UID handler
  91. .org $0000
  92.  ld de,$86f8 ; load de with sizeword thinger
  93.  bit 0,l     ;
  94.  jp nz,_      ; set it else
  95.  res 7,d     ; reset msb
  96.  jp ++_
  97. _:
  98.  set 7,d
  99. _:
  100.  recvtframeprocessed:
  101. ;2
  102.  
  103. ;1 RecvFR          returns the size of the recived frame
  104. .dw recvframesize         ;lable to thinger that states its the end
  105. .db %00001000
  106. .db t2ByteTok, tInvNorm  ;tok
  107. .db %00000010         ; uses r
  108. .db 0
  109. .org 0
  110.  ld hl,$86f8
  111.  ld h,0
  112. recvframesize:
  113. ;2
  114.  
  115. ;1 RecvFRR         returns a pointer to the adress of the id
  116. .dw recvframeid         ;lable to thinger that states its the end
  117. .db %00001000
  118. .db t2ByteTok,tInvNorm  ;tok
  119. .db %00000100         ; uses rr
  120. .db 0
  121. .org 0
  122.  ld hl,$86f3
  123. recvframeid:
  124. ;2
  125.  
  126. ;1 SendF(0/1)            ;sets the send buffer flag to 0/1
  127. .dw sendframeprocessed          ;lable to thinger that states its the end
  128. .db %00001000
  129. .db t2ByteTok,tTCDF  ;tok
  130. .db %00000000         ; uses r
  131. .db 1       ;arguments
  132. .org $0000
  133.  ld de,$87ff ; load de with sizeword thinger
  134.  bit 0,l     ; if it is two
  135.  jp nz,_      ; set it else
  136.  res 7,d     ; reset msb
  137.  jp ++_
  138. _:
  139.  set 7,d
  140. _:
  141. sendframeprocessed:
  142. ;2
  143.  
  144. ;1 SendF(lengthof data)r
  145.  
  146. .dw sizesend          ;lable to thinger that states its the end
  147. .db %00001000
  148. .db t2ByteTok, tTCDF  ;tok
  149. .db %00000010         ; uses r
  150. .db 1       ;arguments
  151. .org $0000
  152.  ld de,$87ff
  153.  ld h,$80
  154.  ex de,hl
  155.  ld (hl),de
  156. sizesend:
  157. ;2
  158.  
  159. ;1 SendF(ptr2ID)RR
  160. .dw sendframeid         ;lable to thinger that states its the end
  161. .db %00001000
  162. .db t2ByteTok, tTCDF ;tok
  163. .db %00000100         ; uses rr
  164. .db 1
  165. .org 0
  166.  ld de,$87fa
  167.  ld bc,5
  168.  ldir
  169. sendframeis:
  170. ;2
  171.  
  172. ;1 RBuff     returns a pointer to the recieve buffer
  173. .dw recvbufff         ;lable to thinger that states its the end
  174. .db %00001000
  175. .db t2ByteTok, tTPDF  ;tok
  176. .db %00000000
  177. .db 0
  178. .org 0
  179.  ld hl,86f8
  180. recvbufff:
  181.  
  182. ;2
  183.  
  184. ;1 RBuffR     clears the recive buffer
  185. .dw clearrbuff         ;lable to thinger that states its the end
  186. .db %00001000
  187. .db t2ByteTok,tTPDF  ;tok
  188. .db %00000010
  189. .db 0
  190. .org 0
  191.  ld de,86fb
  192.  ld hl,86fa
  193.  ld (hl),0
  194.  ld bc,255
  195.  ldir
  196. clearrbuff:
  197. ;2
  198.  
  199. ;1 SBuff    returns a pointer to the send buffer
  200. .dw sendbufff         ;lable to thinger that states its the end
  201. .db %00001000
  202. .db $BB,$1D  ;tok
  203. .db %00000000
  204. .db 0
  205. .org 0
  206.  ld hl,$8801
  207. sendbufff:
  208. ;2
  209.  
  210. ;1 SBuffR   clears the send buffer
  211. .dw clearsbuff         ;lable to thinger that states its the end
  212. .db %00001000
  213. .db $BB,$1D  ;tok
  214. .db %00000010
  215. .db 0
  216. .org 0
  217.  ld de,8802
  218.  ld hl,8801
  219.  ld (hl),0
  220.  ld bc,255
  221.  ldir
  222. clearsbuff:
  223. ;2
  224.  
  225. ;1 TokenHooks
  226. .dw hNormalPDF
  227. .db 4
  228. .db "CnOn"
  229.  
  230. .dw hDNormal
  231. .db 4
  232. .db "CnOn"
  233.  
  234. .dw hInvNorm
  235. .db 5
  236. .db "RecvF"
  237.  
  238.  
  239. .dw hInvT
  240. .db 7
  241. .db "TheGame"
  242.  
  243.  
  244. .dw hTPDF
  245. .db 5
  246. .db "RBuff"
  247.  
  248. .dw hTCDF
  249. .db 5
  250. .db "SendF"
  251.  
  252. .dw $BB1D
  253. .db 5
  254. .db "SBuff"
  255.  
  256. ;2
  257.  
  258. ;This is then repeated.  You can have as many token replacements as memory will allow.
  259. ;Please note that you cannot replace tokens that Axe already replaces internally.
Advertisement
Add Comment
Please, Sign In to add comment