The calculators' standard programming language is a variation of the old BASIC programming language. The calculator manual really tells you all you need to know, but if you need further examples, any book or website on BASIC or QBasic will give you what you need. TI has a web page that goes over the fundamentals. Those pages are written for the TI-85/86, but programming for the other calculators is much the same, except that the syntax and menus will differ slightly. ticalc.org has some columns on BASIC programming for the various calculators. It can also be educational to look at the code from other people's programs.
More Basic tutorial pages:
Basic Guru Online (83(+)/84+)
MJS 2000 (83(+)/84+)
Guide to Programming the TI-86
Calculators from the same model family (82/83(+[SE])/84+[SE], 85/86, or 89(Ti)/92(+)/V200) use the same commands and file format, though the newer calculators in each family have some commands that the older calculators of the group won't recognize. All Basic programs are transferable inside a model family, but the oldest calculator in the family will error with programs using commands that only the newer calculator have. As an additional incompatibility, the 89(Ti) will error if it runs a program from a 92(+)/V200 that tries to draw beyond the edge of the 89's smaller screen. Also, the 83 and 86 moved implied multiplication in the order of operations compared to the 82 and 85. 1/2x is now treated as 1/2*x instead of 1/(2x), and cos 2x is now cos 2*x instead of cos (2x). This will cause bad results in programs that use implied multiplication improperly.
Bringing programs across the gap between different model families requires minor rewriting, since similar commands have different names and argument structures. Some of the Graph Link programs have converters too (they don't work perfectly, though), but it is not hard to do manually by comparing the command indexes in the back of each manual.
Assembly programs are a different story. Assembly shells and programs for the older calculators tend not to work unaided on a different model calculator. Some even have trouble between different ROM versions of the same model calculator. The source code can be recompiled to work on different models, however. Most popular assembly games do have versions for several calculators. There has been some success with shell emulators as well, which allows one model to pretend it's another when running assembly programs. Additionally, the newer models have much improved compatibility between each other, even for assembly. Assembly programs for the 83 Plus tend to run on all 83 Flash family calculators, and programs for the 89 and 92 Plus tend to run on the 89 Titanium and Voyage 200, respectively.
Early information on the TI-86 gave the impression that the TI-86 could transfer any file to a TI-85. It even has a special command in its link menu to do this. In truth, all files except calculator backups and BASIC programs will send to an 85. I suspect that TI meant for the 86 to be able to send programs but couldn't get it working in time for the 86's release. The easy way to give an 85 a basic program from an 86 is to send the program to a computer using a TI Connectivity cable, then copy and paste the program text from the 86 Graph Link to the 85 Graph Link program, then send the program to the 85.
If you don't have a Connectivity cable, you can still do it, it just takes a lot of work. This method was invented by Matt Musante. First, replace every store arrow () and quotation mark (") in the program with a different character. Suggested are the small E for the arrow and the carat (^) for the quotes. Then, delete every line break and put a colon (:) where they were. The entire program should now be on one line. Add a quote (") to the very beginning and end of the program, and finish it off with a store arrow and a variable name. For example:
:Input x :x+1x :Disp "plus one is" :Disp x
becomes
:"Input x:x+1Ex:Disp ^plus one is^:Disp x"STRING
Now, run the program and the code is stored as a string to the name you specified. The string can be sent to the 85 with the calc to calc link cable. On the 85, create a new program and recall (2nd-RCL) the string into the empty program code screen. Then undo everything you did before. (Though technically, you can leave the colons in place of the line breaks if you want to. They both mean the same thing.) Assuming it contains no commands that are exclusive to the 86, the program will now run on the 85.
Stop and think about this in the context of a TI graphing calculator. Think about what the arrangement of characters looks like and what would logically fit into the program code you are copying. Still stumped? "\->\" means the store arrow (). The backslashes "\ \" mean this is a symbol that cannot be typed on a computer keyboard, so this is the best reconstruction of it. This is done with other calculator symbols that can't be typed, and sometimes the slashes are left off. You can avoid confusion by using the Graph Link software with the TI font properly installed instead of copying from a text file.
The examples that follow contain generic TI Basic code, syntax adjustments are necessary depending on which calculator you are using.
(The 8x calculators have this problem, but it has not been observed on the 89 family.)
Every time you use Then with an If statement, the calculator expects to come across the corresponding End command. Even when you use nested If Then statements, it keeps count of how many End commands should be coming up. However, if you use Goto before the End command occurs, the calculator does not get the chance to remove it from the count. The same with using Goto to leave a While, Repeat, or For loop. Do this enough times, the memory will run out and the program will crash. It is not hard to work around the problem, it only takes a little creativity.
:If x=1 :Then :2y :Goto A :End
is better off as:
:If x=1 :2y :If x=1 :Goto A
Depending on the complexity of the code, other methods may be required.
:If x=1 :Then :2x :2y :Goto A :End
can be changed to:
:0q :If x=1 :Then :2x :2y :1.5q :End :If q=1.5 :Goto A
A subroutine is code that will be used multiple times from different places in a program. Ordinarily, a subroutine is performed by running another program from within the main program. However, when distributing programs to friends, people often forget to include the necessary subprograms. It is so much nicer when the program is entirely self-contained. This is easy to do on the TI-89 family, where programs can be defined inside a program:
:Local subprog :Define subprog()=Prgm ... subroutine code ... :EndPrgm ... program code ... :subprog()
On the TI-8x calculators, more creativity is required. Here is one method:
... program code ... :0q :Lbl A ... subroutine code ... :If q=1 :Goto B :If q=2 :Goto C ... program code ... :1q :Goto A :Lbl B
Note that while this keeps everything within one program, it will cause the program to run more slowly overall due to more extensive use of Goto. This is because the calculator must search for the corresponding Lbl every time it is used.
This simple program demonstrates making something move on the graph screen using the getKey command. (I used the GetKey numbers from a TI-8x calculator. Refer to the back of the manual for the TI-89 family) I wrote it in a hybrid generic TI Basic for clarity, as it is written it will not function on any calculator. Note that the technique is very slow for complicated pictures as the Graph-Draw commands aren't all that speedy. Slightly better but still not great is using the Output command and alphanumeric characters to make ASCII art move on the TI-8x's home screen or the TI-89 family's program I/O screen. Assembly is the best language for arcade-type games though.
ZoomInteger 0X 0Y PointChange(X,Y) Lbl A getKeyG 0DX If G=24 -1DX If G=26 1DX 0DY If G=25 1DY If G=34 -1DY If G=105 Stop If G>0 Then PointChange(X,Y) X+DXX Y+DYY PointChange(X,Y) EndIf Goto A
This simple program demonstrates something that moves independently of user input, like a pong style bouncing ball:
ZoomInteger Line(5,5,20,5) Line(20,5,20,15) Line(5,5,5,15) Line(5,15,20,15) 7X 9Y PointChange(X,Y) 1DX 1DY Lbl A If X=6 or X=19 -DXDX If Y=6 or Y=14 -DYDY PointChange(X,Y) X+DXX Y+DYY PointChange(X,Y) Goto A
Time is taken up by every command line a program performs. To create a timed pause in the program's execution you need only make it go through many lines without actually doing anything. An empty For loop fits the bill. Adjust the 1000 to any number you please depending on the length of the delay you want.
... program code ... For(X,1,1000) End ... program code ...
There are two main methods for picking random numbers from a list without repetition. The first mixes up the list and then reads it out in order, the second is a somewhat shorter method I came up with where the list starts out intact but you draw numbers from it in random places. Ricky Cobb wrote in to point out a better way to perform the first method using the sort commands (SortA or SortD on the 83 family and 89 family, Sortx on the 85/86). These are written in a hybrid generic TI Basic for clarity, as they are written they will not function on any calculator.
Method 1a: Mixing up the list
{1,2,3,4,5}L1 dim(L1)D For X,1,D RandInt(1,D)R L1(X)T L1(R)L1(X) TL1(R) EndFor Disp "Getting the numbers" For X,1,D Disp L1(X) EndFor
Method 1b: Mixing up the list with sort
{1,2,3,4,5}L1 dim(L1)D seq(rand,X,1,D)L2 Sort L2,L1 Disp "Getting the numbers" For X,1,D Disp L1(X) EndFor
Method 2: Picking from the list at random
{1,2,3,4,5}L1 dim(L1)D Disp "Getting the numbers" For X,1,dim(L1) RandInt(1,D)R Disp L1(R) L1(D)L1(R) D-1D EndFor
Normal programs are written in TI-BASIC, a variation of the old BASIC language that is similar to QBasic. TI-BASIC programs are handled by the calculator operating system (known as the TI-OS), the same system that controls the home screen and graph screen. Assembly (ASM) accesses the calculator's functions directly using machine code, allowing more speed and control, like the C language on computers. TI-8x calculators use the ZiLOG Z-80 processor chip and language. The TI-89 family calculators have a Motorola MC68000 chip. The TI-82, 85, and 92 have hacked shells that are used to run assembly programs. All subsequent calculators have built-in assembly support, but some use shells anyway to provide a library of commonly used routines. TI-85 assembly programs are most often stored as string files, all the other calculators normally encode assembly programs within standard program files.
TI has some assembly information for the 86 and 89 Flash family at their site as well as Software Development Kits for the 83 Flash family and 89 Flash family. ticalc.org's file archive contains documents relating to Z-80 and MC68000 (TI-89 family) programming, hardware protocol information for all TI calculators, and utilities for creating assembly programs.
There are many other sites on the internet with ASM information (though there is quite a bit of
duplication between them). Some that I have seen are:
Assembly Coder's Zenith
Tutorials (82, 83, 86)
TI-82 ASM Corner
TI-83 Asm Guide
ASMGuru/AppGuru (83(+[SE])/84+[SE])
Dux Gregis's site (86)
TI86 Asm Programming Guide
Welcome to Asm86!
Joshua's TI-86 Site
Techno-Plaza (89 Flash family)
Kevin Kofler's nostub tutorial
ti-cas.org (89 Flash family)
ticalc.org
If you come across a really good one that I do not have listed, please e-mail its location to me.
Some people prefer to use C instead of assembly to create machine code programs for the TI Calculators. This can be accomplished using z88dk for the TI-8x and TI-GCC for the TI-89 Flash family.
Originally, hackers had to find a "hole" in the calculator's operating system to access the CPU and run assembly programs. Starting with the TI-83, TI intentionally built trapdoors into the TI-OS to allow assembly programs to run with no need for a hacker written shell. However, several programs properly or improperly using the name shell do exist for these calculators which provide additional features, primarily a menu for easy access to the other assembly programs on the calculator. Some shells provide password protection of the calculator as well. The true shells also provide a library of commonly used routines that helps cut down on the size of the programs that run under them.
Shells include Ashell83, SOS, Ion, and ZeS. Ion is the most commonly used TI-83 shell. These are true shells since they provide extended memory support. Most 83 assembly programs require a shell to run. To run assembly programs that do not require a shell (if there are any) from the home screen, use the following syntax: Send(9prgmNAME . It's been reported that the 83 in the new case is incompatible with older 83 assembly programs.
The 83 Flash family won't run 83 assembly programs. The 83 Plus Silver Edition is generally compatible with 83 Plus assembly programs, although speed issues often cause separate versions to be produced. Presumably whatever works on the 83 Plus Silver Edition will be okay on the 84 Plus and 84 Plus Silver Edition, but it's too early to say for sure. The first shell out for the 83 Plus was Ion, which has a version for both the 83 and 83 Plus. Programs written for Ion require it to run. Other shells include Ice, Inferno, Izzard, CrunchyOS, GlobalOS, Doorways Pro, Plasma, PSE, and NimbusOS. Most if not all of them are Ion-compatible. MirageOS is a Flash application shell, it is also Ion-compatible. Ion seems to be the de facto standard for TI-83 Flash family assembly, the only attempt at an alternative that I am aware of is TSE. MirageOS is the most commonly used TI-83 Flash family shell. There's a nice comparison of several shells here. To run assembly programs that do not require a shell (if there are any) from the home screen, use the following syntax: Asm(NAME .
The 83 Flash family SDK is currently available from TI.
The TI-86 has the distinction of being the only calculator for which assembly programs are regularly written based around the calculator's native assembly functions and not any specific shell. Shells for the 86 are there mostly to provide program menus and other assorted goodies. Shells include ASE, Anaconda, Rascall, Byronic Shell, Mini-Shell, Micro Shell, Omega Shell, Iridus, YAS, Zap-2000, and Ion86 (Ion emulation). Shells from the 85 won't run on the 86, but a few of the 86 shell do provide ZShell emulation for running 85 assembly programs on the 86.. To run assembly programs from the home screen, use the following syntax: Asm(NAME . The Asm( command is found only in the catalog, but it can be placed in the custom menu for quick access.
(See also: the TI-89 Flash family section of Patrick Davidson's FAQ)
The 89 Flash family contains built in assembly abilities like the 83 and 86, however programming using shells and/or kernels remains popular, and they must be used for many assembly programs. Available shells and kernels for the 89/92+/V200 include Doors OS, TEOS, VisualOS, Prosit, PreOS, ProShell, Universal OS, and LexOS. (The shells provide a menu list of available programs, but you can also run them from the command line like Basic program as long as the kernel is installed.) These shells often make use of external library files that are required to run certain games. DoorsOS was once the most popular, but it has fallen into disuse. Universal OS and PreOS are the most commonly used kernels for the 89/92+/V200.
The TI-89 Titanium, as with most new models, sent programmers scrambling to update the kernels. Iceberg can be used in concert with the HW3 patch and older 89 Flash family programs that have been patched using GhostBuster. The latest version of PreOS also supports the 89Ti. As to which is better to use, it's all still so new that opinions have yet to emerge.
Note that the shells and programs written for the 89 Flash family are made for specific ROM (AMS) versions. If you Flash upgrade beyond the version the shell was designed under, it will probably not function. If you have already done this, you can e-mail TI for the old ROM (provided your e-mail provider can accept file attachments that large). Also note that if your calculator came with AMS 1.05 or higher, that means you have Hardware Version 2.00 and cannot downgrade to AMS version 1.00. Of course at this point, if the shell you have won't work with at least AMS 2.05, it's so outdated you probably shouldn't be using it anyway.
There is also the issue of the hardware version. Program size limits imposed by TI in Hardware Version 2 and various other complicated things that the programmers don't like having to deal with are defeated by applying a patch file to the AMS. Part of what the patch does is to make the AMS allow TSR hooks for the purpose of enabling memory resident programs and a few other things which are not allowed by the OS by default. The HW2 patch can be found at ticalc.org. The HW2 patch is not needed when using the PreOS kernel. There's also a HW3 patch for the TI-89 Titanium (it works in place of the HW2 patch on the earlier calculators as well). If the appropriate patch or kernel is not installed, the size limit manifests itself as the error message "Error: ASAP or Exec string too long".
Assembly programs termed nostub tend to work across a wider variety of AMS versions as they are, and they generally do not require a shell or kernel at all unless it is to avoid the size limit. Many 89 Flash family owners only use assembly programs that are nostub, and their popularity has increased while the disadvantages and difficulties of using shells have remained. The TI Chess Team has developed a nostub Start Utility that is intended to defeat the size limit for nostub programs without using a shell or the HW2 patch. KerNO is another program for nostub users, it provides features that kernels do while remaining nostub.
If it sounds like things are a mess, it's because they are. Changing standards with every new hardware or AMS release keep the assembly programmers scrambling to keep up. It settled down a bit after the release of the SDK with better assembly reference material, in addition to the proliferation of nostub programs. In lieu of the SDK, some programmers instead use TI-GCC, a TI-89 Flash family modification of a C compiler. TI-GCC is available from ticalc.org.
One more thing, buggy assembly programs and shells have been known to corrupt the math operations of the calculator. If things start acting strangely, try resetting the memory or reloading the ROM (AMS).
On a partially related note, the 89 Flash family calculators also have an Exec command that will execute 68000 op-codes in a string. These op-codes are essentially what makes up an assembly program after it is assembled. It is impractical to run large programs using the Exec command though, it appears to be designed for use on a small scale. Anything done with the Exec command takes twice the amount of space of the equivalent done in traditional assembly. The Exec command can be put into TI-Basic programs though, something that is more problematic with traditional assembly. The Exec Maker program will create Exec command strings.
Ash, CrASH, and OS-82 are 82 ASM shells.
There are several 85 assembly shells out there, ZShell is the most widespread as it was the first one. However, all subsequent 85 ASM shells have retained ZShell compatibility. ZShell was developed by hackers and likely is the reason it occurred to TI to build ASM capability into the calculators starting with the 83. TI does not support or acknowledge the existence of ZShell or other hacker made programs. It works because the hackers messed with an 85 computer backup and stuck a command in the custom menu pointing to a place in memory that gave them access to the Z-80 processor functions. ZShell and the other TI-85 shells can only be installed by backup from a computer or another 85 because the command can't be put in the custom menu from the calculator. If the command is erased from the menu, the ZShell backup must be reloaded. Other 85 ASM shells include Usgard (probably the most popular after ZShell), SuperNova, Rigel, PhatOS, CShell-NT, Menu Independant SHell, OS/7, OS-85, and Summit.
Only one shell was ever made for the original TI-92, Fargo. Fargo II updated the original Fargo, though a program module is available that allows Fargo II to run programs written for the original Fargo. Be sure to read the fargo.txt file that comes with the Fargo program files for instructions on installing Fargo to your TI-92. A TI-92 with the Plus Module will use its own ASM capability, without need for Fargo.
Fargo and Fargo II utilize add-on files called libraries which contain common routines for use by programs. Most programs require a specific set of library files to run. This is done to save space (instead of each program having a copy of a routine, they share a single copy), however it has been known to cause confusion.
Interestingly enough, years after the original 92 has faded from most people's memory, it seems the TIGCC folks are experimenting with allowing one to make Fargo programs using TIGCC.
Some assembly programs generate very primitive sound effects by sending signals to the calculator's link port. You listen to it by plugging in speaker or headphones via a 2.5 mm male to 3.5 mm female stereo adapter plug.
Here's a brief explanation of how it works, taken from 86 Central:
Sounds are Sine Waves. We can simulate sound waves with square waves, which can be
produced by rapidly turning on and shutting off the speakers. You turn on the speaker by turning
on the link port wires, wait a delay, and shut them off. Then you wait another delay, and turn
them on again. Make sure the delays are equal. You have sound! Different delay times make
different notes.
Included with most assembly programs are documentation and the source code file, which uses the file extension asm. The source code is the raw form of the program, which is then assembled by the program's author into a form that the calculator can use (called machine language), which is stored in an ordinary calculator program file (or a string file in the case of the TI-85). Only this final file is needed to operate the program, the source code is provided for educational purposes only. It is not recognized by the Graph Link software or TI Connect and can not be typed into the calculator. Some assembly programs also make use of include files, which have file extensions of h or inc. These files are source code fragments that set up commonly used routines or functions that are used by the main source code. The source code and include files are in plain ASCII text, they can be viewed with any text editor or word processor.
Flash Applications are a specialized form of assembly program that is stored in Flash ROM and accessed via the APPS menu. They allow a greater degree of integration with the calculator's OS. Most are written by TI and can be downloaded from their website.
Though TI's marketing sometimes depicts the calculators as nothing more than a platform for running Flash Applications, they are not the only type of program that can be used by the calculator. Basic and assembly programs both predate Flash Applications and appear in the same place they always have, the PRGM menu or the Var-Link screen (TI-83 family and TI-89 family, respectively). Note that the old TI-83 has a PRGM key but no APPS key. Basic and assembly programs cannot be moved to the APPS menu, they aren't supposed to be there and don't need to be there. Typically with the 83+/84+, you select MirageOS from the APPS menu and select the assembly program you want from there. See the Guide to Games for instructions on running such programs.
That said, third party programs can often provide new functionality, such as the Integrated Desktop programs that allows you to add icons for a great variety of things to the 89 Flash family's APPS desktop.
MirageOS is an assembly shell made by Detached Solutions for the 83 Flash family. The Detached Solutions website has its manual and a forum for it.
MirageOS stores data in two files. The Flash Application itself, and an AppVar (short for application variable) of the same name. The AppVar is much smaller and is kept in the archive. It stores the settings and options, including the password. If you forget your password or set it accidentally, unarchive and delete the MirageOS AppVar via the 2nd-MEM 2:Mem Mgmt/Del menu. If you have activated MirageOS's ability to block entry to the MEM menu, either overwrite your copy of the AppVar with one from another calculator or see entry 9.1 about methods to force a memory reset.
Assembly games that do not automatically show up in MirageOS's menus are likely not compatible with MirageOS. Check the game's readme/documentation file. Basic programs will be detected by MirageOS if their fist line of code starts with a colon, as described in the MirageOS manual.
There is a known issue between MirageOS and the LCD screen used in some of the calculators. Please consult the MirageOS forum for details.
Many games and other more useful math and science programs have been written for all TI graphing calculators. They can be found in archives on the internet. The most notable is kept by ticalc.org, others are kept by CalcGames.org, calc.org, and TI. These archives will take submissions of programs you have written. (Note: TI's archives do not have assembly programs for the TI-82, TI-85, and TI-92. These are not supported by TI due to their hacker origins.) A variety of Flash Applications, most free, can be found at TI's website.
Also, there are a few good sites dedicated entirely to useful programs. The TI Calculator
Programs site serves all calculators, while the rest are for the TI-89 family:
Soft Warehouse TI-92 program library
The TI-89/92 Mathematical Software Library
Frank Westlake's page
Bhuvanesh Bhatt's page
Glenn Fisher's Page
Roberto Perez-Franco's page
Kevin Kofler's Homepage
ti-cas.org
The TI Connectivity cable or Graph Link software is used to put programs on the calculator after you have downloaded the file using your internet browser and decompressed it if necessary. TI-Basic games and programs are run as described in the manual's Programming chapter. Assembly games and programs will not run in the same manner, and often require you to install a shell on your calculator. For information, look up your calculator in the Assembly section.
Read my step by step guide to getting games onto your calculator.
ticalc.org also has a linking tutorial that covers much of the same material as above.
There's a handful of programs out there that come highly recommended, perform a frequently asked for function, or just have some unique coolness factor. This list is provided so that people won't have to go digging through the massive program archives to find the stuff that's actually useful. Note that I've not personally used most of these programs, please direct questions and problems to their respective authors. Thanks to all those who have contributed to this list, and nominations of programs to add to the list are always welcome.
General
Symbolic - Adds new functions to the TI-83 Flash family via Flash App
Omnicalc - Adds new functions to the TI-83 Flash family via Flash App
Prettypt - Pretty print on the TI-83 Flash family
tSimplfy - Simplifies trig output from the 89 Flash family using csc, sec, and cot
EQW - Equation Writer, input in pretty print on the 89 Flash family, inspired by the HP49G's feature
EQW Flash App - New and improved Equation Writer in TI's store, though this version's not free
Hail Expression Writer - Another program for inputting in pretty print style
XtraKeys - Maps more diamond functions to the 89(Ti)'s keyboard
Differential Equations - For the 89 Flash family
Advanced Laplace - For the 89 Flash family
3D plotter - For the 89 Flash family, because the built in 3D abilities don't do much
Subject specific
Finance - TI adds business calculator functions to the 86 and 89 Flash family
Advanced Statistics - TI adds additional statistics functions to the 86 and 89 Flash family
AP Calculus TI-89 - Removes the thought process from calculus class. At least it's not free
Symbulator - A symbolic circuit simulator on the 89 Flash family for electrical engineers
Z Transform - Z Transform functions, among other things on this site
Al-Chemistry - Suite of chemistry utilities for the 89 Flash family
YAPT - A nostub periodic table for the 89 Flash family
Sigfigs - Perform arithmetic while obeying significant figures on the 83 Flash family, 86, or the
89 Flash family
Nexus - A surveying utility
Advanced
RPN - Reverse Polish Notation interface for the 89 Flash family, like what the HP calculators use
Non Math
eBook Reader - For the 89 Flash family
On line since Sept. 1997 visitors since 8/1/2001 |
|
NOTICE: This site has no legal affiliation with Texas Instruments Incorporated. The owners and
operators of this site are solely responsible and liable for any content or goods on or obtained
from this site. Texas Instruments Incorporated ("TI") makes no representation with respect to the
suitability of any of the information contained in any content or non-TI goods obtained from this
site. In no event shall TI or its licensees be liable for any damages whatsoever, including special,
indirect or consequential damages, arising out of or in connection with the use of or performance
of the content or non-TI goods obtained from this site.
TI-Graph Link and Voyage 200 are trademarks of Texas Instruments.