A83: Making Programs


[Prev][Next][Index][Thread]

A83: Making Programs




Here is the source for a program i made that creates a program
and then copies a small basic routine into it. if you run it, it
displays "IAN IS A PIMP". make note that you can't use lowercase letters
in basic program because they are 1 byte tokens when compiled into asm,
but are 2 byte tokens when typed in through the graph link software
(there isn't any way to enter lower case letters on the calculator).

i hope that all made sence. hopefully the commented source will help


.NOLIST
#define equ .equ
#define EQU .equ
#define end .end
#include "ti83asm.inc"
#include "tokens.inc"
.LIST

_createprog .equ 448Ah
PROGOBJ .equ 05h

.org 9327h

     call _zerooop1    ;
     ld hl,progname    ; the name of the prog
     ld de,op1         ; copy it to op1
     ld bc,5           ; 5 chars in name
     ldir              ; do the copying
     call _chkfindsym  ; look it up
     call nc,_delvar   ; if it is there delete it (to keep things clean)
     ld hl,15          ; length of program (in bytes)
     call _createprog  ; create it
     inc de            ; skip 1st length byte
     inc de            ; skip 2nd length byte
     ld hl,prog        ; program data
     ld bc,15          ; program data length
     ldir              ; copy data
     ret               ; all done!

progname:

     .db PROGOBJ,"IAN",0  ; object type prog, name "IAN", 0 terminator

prog:

     .db tDisp,tString,"IAN",tSpace,"IS",tSpace,"A",tSpace,"PIMP"  ;
Disp "IAN IS A PIMP

.end
END


Follow-Ups: