Writing Your First Program We'll start right off with a sample program. This will give you a sample and feel of the language, and teach you how to use the debugger. In the first program, we'll just clear the screen. In DOS (Go to Start, Programs, Accessories, MS-DOS Prompt; or Start, Programs, MS-DOS Prompt). Type "edit myprog.z80". Type in the code below:
.NOLIST
#define EQU .equ
#define equ .equ
#define END .end
#define end .end
#include "ti83plus.inc"
.LIST
Some notes and a breakdown of the program:
The tabs are essential. It doesn't matter if they are tabs or just a space, but it is essential to have some kind of seperation.
This is the header of your program. The .NOLIST and .LIST turn on and off listing (the list is another output file that may be used for debugging). The EQU, equ, and END are being defined as .equ, .equ, and .end respectivley. "#define A B" defines A as B, so you could type A and it would be the same as typing B. #include, as in other programs, includes a file. In this case, it's including ti83plus.inc, which has all the defines and equates that you'll need.
.org 9D93h
.db $BB,$6D
This section of the program is also required for every ASM program. The .org 9D93h tells the calculator where the program starts in memory. The .db $BB,$6D is the compiled AsmPrgm token. This tells the calculator that this is an ASM program.
B_CALL(_ClrLCDFull)
This is the body of your program. Since this is a simple program, we have only one command here. But this is where all the code is put.
ret
end
This is the end of your program. "ret" returns the program to the Ti-OS. This is a REQUIRED command, and if left out will cause the calculator to crash. The end tells the calculator that this is the end of the program.