In this lesson you will write your first program for the TI-82!
Well, you're not going to write it yourself, I'm going to give it for you.
The programs in this lesson and all the following lessons are for Ash 3.0 or above, unless otherwise stated.
Programming for CrASH isn't much different from ASH programming. Most (or all) of the ASH programs work perfectly on CrASH too. We will spend some time on explaining how to compile a program for CrASH only.
The program |
Explanation |
Compiling
If you want to compile your program, you will need some programs to do this.
There are two common shells on the TI-82: Ash and CrASH. When compiling a program specifically for a certain shell you will need different files.
The examples in these lessons are all written for Ash 3.0.
Ash
Files you need |
Name |
Description |
Ash 3.0 |
The shell for your calculator. This package also contains the PRGM82.EXE, TI82.H, KEYS.INC and ASM.BAT files that you will need |
TASM 3.1 |
The assembler that will translate your sourcecode to Z80 machine language. (TASM runs in DOS. A linux version is available from the TASM home page) |
Now that you have all the files, you can compile your program.
Create a directory and put the following files in there : TASM.EXE, TASM80.TAB, ASM.BAT, PRGM82.EXE, TI82.H and KEYS.INC.
Create a new file which you call 1STPROG.ASM for example. In that file, you type (or cut and paste) the program from the top of this page. Don't use Word or any other fancy program to do this. Just use Notepad or EDIT.COM in DOS.
Make sure that there is a space in front of each line that is not a label and that does not start with '#' or '.'. If you don't do this, TASM will complain about it or your program won't run as expected.
The best programs to make and edit .ASM files are a simple text editor such as MS-DOS EDIT.COM, Windows NOTEPAD.EXE or TextPad
To compile your program, you have to open an MS-DOS prompt (There's a shortcut in the Win-95/98 Start Menu or you could do Run-'command').
Once at the MS-DOS Prompt, go to the directory where your program is and type :
C:\TI82>asm 1stprog (Leave off the .asm extension !)
The asm.bat file will run TASM first and after that, it will create a .82P file out of the output from TASM with PRGM82.EXE. This last program also fixes the checksum of the 82P-file.
If TASM encounters errors, they will be listed on your screen. If you copied the source correctly, you should not see any problems.
The 1stprog.82p file created by asm.bat can now be sent to the calculator using your Graph Link or Homemade Link (see Linking for more info about this)
Make sure that you load Ash on your calculator BEFORE you load 1stprog !
When you start the program on your calculator, the output will look like this !
CrASH 1.6
Compiling a program for CrASH is done in a slightly different way:
Files you need |
Name |
Description |
CrASH 1.6 SDK |
The shell for your calculator. This package also contains the CRPRGM82.EXE, CRASH82.INC and CRASM.BAT files you will need |
TASM 3.1 |
The assembler that will translate your sourcecode to Z80 machine language. (TASM runs in DOS. A linux version is available from the TASM home page) |
Now that you have all the files, you can compile your program.
Create a directory and put the following files in there : TASM.EXE, TASM80.TAB, CRASM.BAT, CRPRGM82.EXE, CRASH82.INC and the ASM file you want to compile.
To compile your program, you have to open an MS-DOS prompt (There's a shortcut in the Start Menu or you could do Run-'command').
Once at the MS-DOS Prompt, go to the directory where your program is and type :
C:\TI82>crasm progname (where progname is the name of the .asm file without the extension)
The crasm.bat file will run TASM first and after that, it will create a .82P file out of the output from TASM with CRPRGM82.EXE.
If TASM encounters errors, they will be listed on your screen.
Previous lesson |
Contents |
Next lesson