Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;#######################################################################;
- ; ___ ___ ___ __ ______ .___ ___. ______. ;
- ; / \ \ \ / / | | / __ \ | \/ | / | ;
- ; / ^ \ \ ' / | | | | | | | \ / | | (---` ;
- ; / /_\ \ > < | | | | | | | |\/| | \ \ ;
- ; / _____ \ / . \ | | | `--' | | | | | .---) | ;
- ; /__/ \__\ /__/ \__\ |__| \______/ |__| |__| |______/ ;
- ; ;
- ; The Assembly SDK for Axe programmers ;
- ; By Kevin Horowitz ;
- ; Last revision: 1.1.2 ;
- ; ;
- ; This template will make it easy to implement real assembly commands ;
- ;into Axe Parser so that they can be used just like the native commands ;
- ;that come with the App. ;
- ; ;
- ;#######################################################################;
- ;###################
- ;# Library header #
- ;###################
- ;You should include "Axe.inc" in your axiom because it contains a lot of useful
- ;definitions to aid in Axiom development. If you're using token replacements,
- ;you should also include "TokenHook.inc".
- #include "ti83plus.inc"
- #include "Axe.inc"
- #include "TokenHook.inc"
- #define B_CALL(xxxx) rst 28h \ .dw xxxx
- Cn2_Setup equ $4209
- Cn2_Clear_SendBuf equ $420C
- Cn2_Clear_RecBuf equ $420F
- Cn2_Setdown equ $4212
- Cn2_GetK equ $4221
- ;All Axioms must start with $DE,$C0:
- .dw $C0DE
- ;####################
- ;# Command Fields #
- ;####################
- ; no args
- ;(normalpdf())
- ;1 CnOn is init calcnet
- .dw initend ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok, tNormalPDF ;tok
- .db %00000000
- .db 0 ;arguments
- ;will originally only use 2 third one is for the inevitable UID handler
- .org $0000
- call cn2_setup
- initend:
- ;2
- ;1 CnOff takes it down
- .dw teardown ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok, tDNormal ;tok
- .db %00000000 ; uses r
- .db 0 ;arguments
- ;will originally only use 2 third one is for the inevitable UID handler
- .org $0000
- call cn2_setdown
- teardown:
- ;2
- ;1 CnONr sets it up and moves stuff around in memory
- .dw moveitlikeaboss ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok, tNormalPDF ;tok
- .db %00000010 ; uses r
- .db 0 ;arguments
- ;will originally only use 2 third one is for the inevitable UID handler
- .org $0000
- moveitlikeaboss:
- ;2
- ;========== General purpost commands
- ;1 RecvF(0/1) sets recieve buffer flag to 0/1
- .dw recvframeprocessed ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok, tDNormal ;tok
- .db %00000000 ; uses r
- .db 1 ;arguments
- ;will originally only use 2 third one is for the inevitable UID handler
- .org $0000
- ld de,$86f8 ; load de with sizeword thinger
- bit 0,l ;
- jp nz,_ ; set it else
- res 7,d ; reset msb
- jp ++_
- _:
- set 7,d
- _:
- recvtframeprocessed:
- ;2
- ;1 RecvFR returns the size of the recived frame
- .dw recvframesize ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok, tInvNorm ;tok
- .db %00000010 ; uses r
- .db 0
- .org 0
- ld hl,$86f8
- ld h,0
- recvframesize:
- ;2
- ;1 RecvFRR returns a pointer to the adress of the id
- .dw recvframeid ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok,tInvNorm ;tok
- .db %00000100 ; uses rr
- .db 0
- .org 0
- ld hl,$86f3
- recvframeid:
- ;2
- ;1 SendF(0/1) ;sets the send buffer flag to 0/1
- .dw sendframeprocessed ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok,tTCDF ;tok
- .db %00000000 ; uses r
- .db 1 ;arguments
- .org $0000
- ld de,$87ff ; load de with sizeword thinger
- bit 0,l ; if it is two
- jp nz,_ ; set it else
- res 7,d ; reset msb
- jp ++_
- _:
- set 7,d
- _:
- sendframeprocessed:
- ;2
- ;1 SendF(lengthof data)r
- .dw sizesend ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok, tTCDF ;tok
- .db %00000010 ; uses r
- .db 1 ;arguments
- .org $0000
- ld de,$87ff
- ld h,$80
- ex de,hl
- ld (hl),de
- sizesend:
- ;2
- ;1 SendF(ptr2ID)RR
- .dw sendframeid ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok, tTCDF ;tok
- .db %00000100 ; uses rr
- .db 1
- .org 0
- ld de,$87fa
- ld bc,5
- ldir
- sendframeis:
- ;2
- ;1 RBuff returns a pointer to the recieve buffer
- .dw recvbufff ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok, tTPDF ;tok
- .db %00000000
- .db 0
- .org 0
- ld hl,86f8
- recvbufff:
- ;2
- ;1 RBuffR clears the recive buffer
- .dw clearrbuff ;lable to thinger that states its the end
- .db %00001000
- .db t2ByteTok,tTPDF ;tok
- .db %00000010
- .db 0
- .org 0
- ld de,86fb
- ld hl,86fa
- ld (hl),0
- ld bc,255
- ldir
- clearrbuff:
- ;2
- ;1 SBuff returns a pointer to the send buffer
- .dw sendbufff ;lable to thinger that states its the end
- .db %00001000
- .db $BB,$1D ;tok
- .db %00000000
- .db 0
- .org 0
- ld hl,$8801
- sendbufff:
- ;2
- ;1 SBuffR clears the send buffer
- .dw clearsbuff ;lable to thinger that states its the end
- .db %00001000
- .db $BB,$1D ;tok
- .db %00000010
- .db 0
- .org 0
- ld de,8802
- ld hl,8801
- ld (hl),0
- ld bc,255
- ldir
- clearsbuff:
- ;2
- ;1 TokenHooks
- .dw hNormalPDF
- .db 4
- .db "CnOn"
- .dw hDNormal
- .db 4
- .db "CnOn"
- .dw hInvNorm
- .db 5
- .db "RecvF"
- .dw hInvT
- .db 7
- .db "TheGame"
- .dw hTPDF
- .db 5
- .db "RBuff"
- .dw hTCDF
- .db 5
- .db "SendF"
- .dw $BB1D
- .db 5
- .db "SBuff"
- ;2
- ;This is then repeated. You can have as many token replacements as memory will allow.
- ;Please note that you cannot replace tokens that Axe already replaces internally.
Advertisement
Add Comment
Please, Sign In to add comment