Clearing the screen
First, make sure you have Tasm unzipped into its own folder. It should be named Tasm301 or something like that.
Now make sure Devpac83, ti83asm.inc, and tokens.inc are all in the Tasm folder.
Now open up Notepad. This is where you will be typing all the code. Type the following into a new text file:
.NOLIST
#define equ .equ
#define EQU .equ
#define end .end
#include "ti83asm.inc"
.LIST
This should be at the top of every program you write. Now put this:
.org 9327h
nop ;these 2 lines identify the program
jr prog_start ;as AShell-compatable
.dw $0000 ;Version of table
.dw Description ;Points to the program description
.dw Icon ;pointer to an 8x8 icon (not used)
This code should follow the code above it. This is needed for programs to run under Ashell.
Notice the semi-colons. You put a semi-colon at the end of a line to make the rest of the line a comment.
The words after the semi-colons are comments, and are not compiled into code.
You should also put this, although it could be at the very bottom of your program:
Description:
.db "Clear the screen!"
Icon:
.db %11111111
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %11111111
The description is the text that shows up at the bottom in Ashell. The 8x8 icon is not used in this version of Ashell, but it may be used in a later version.
Now, type:
prog_start:
call _clrlcdfull
The prog_start is a label. Notice how the label is not tabbed in, but the call _clrlcdfull is. You must put some space in front of all lines of code (I'll talk about the exceptions later). I use tabs, but you could also just put spaces if you want.
_clrlcdfull is defined in ti83asm.inc. It is a pointer to a rom call, which is a function TI built into the calcualtor. This rom call clears the display, or lcd.
Now at the end of your program add this:
ret
.end
END
The ret returns from the program to the shell.
The .end and END are needed at the end of all programs.
Notice that the last two lines are not tabbed in.
The only time you don't tab in is when you use things starting with a # like #define or #include, or when using .end or END, and of course, when using labels. So the completed code should look like this:
.NOLIST
#define equ .equ
#define EQU .equ
#define end .end
#include "ti83asm.inc"
.LIST
nop
jr prog_start
.dw $0000
.dw Description
.dw Icon
Description:
.db "Clear the screen!"
Icon:
.db %11111111
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %11111111
prog_start:
call _clrlcdfull
ret
.end
END
Compiling:
Save your code as clear.z80. You will always save your programs with a .z80 extension. Now open up
DOS prompt. Type cd C:\Tasm301, and press enter. Now type zasm clear.z80. It should compile without errors.
The next section will be about using the TI emulator Virtual TI.
Introduction
By: Wade Peterson
Virtual TI