TI-68k Basic for TI-83 Programmers

This tutorial is meant as an introduction to to TI-68k Basic for programmers that already are fairly experienced with TI-83 series Basic programming. Instead of re-teaching many things, this tutorial highlights the differences between the two languages.

Major Features

A major novelty of the TI-68k calculators is the ability to make symbolic calculations. This has many applications: you can deal with expressions such as x2+2*x+1 but treat x as an unknown, or deal with the exact value of √π/3 without approximating it with floating-point values.

The calculator no longer has some statistical commands, but has much more powerful calculus commands (it can do symbolic derivatives, integrals, and finite and infinite sums, among other things). This doesn't have any immediate programming applications, although you can often find an unexpected use for these commands.

A very programming-relevant difference, on the other hand, is the advent of error catching. Using the Try and EndTry statements, your program can identify if an error has occurred, and possibly even recover from this (or at least display a custom error message).

The more specific differences described below tend to combine to make programs run faster, and allow for a programming style closer to programming a more "serious" language on a computer.

Commands

On the TI-89, commands can be entered letter by letter, and don't have to be chosen from a menu. In practice, programs and functions are tokenized, making a command range take up 1 to 3 bytes in a program.

Many commands have been added or removed between the two languages (see the command index for a full list of commands). In addition, the following commands have changed in spelling:

There are two more overall changes. First, many commands' names have been truncated where they were longer than 8 characters: this is the maximum for a command name on the TI-89. An example is RclPic, the 68k equivalent of RecallPic.

Second, the use of parentheses after a command now follows a strict convention.

  • "Instructions" — commands that do not return a value — do not require parentheses (e.g. If, Text, etc.)
  • "Functions" — commands that do return a value — require parentheses (e.g. sin(), setMode(), etc.)
  • Even functions with no arguments use parentheses (e.g. getKey(), startTmr(), etc.)

Variables

The way variables are stored has undergone major changes from the TI-83 series. All variables now share a common naming system: the name of a variable can be up to 8 letters long. Variables can also be placed in different folders, which can't be nested but otherwise are very similar to file folders on a computer. By default, variables are stored in the folder 'main'.

On the surface, the variable types are much the same as they were on the TI-83 calculators: you have numerical variables, lists, matrices, strings, picture variables, equations, and graph databases. These are slightly different, however. To begin with, numerical variables can now be either floating-point (the same as on the TI-83 series) or integer variables (that don't have a decimal place, but have several hundred digits of precision). As a consequence of the symbolic operations on a TI-68k calculator, you also have expressions: formulas that are only evaluated as much as possible.

Lists and matrices are even more different: they can contain any mix of numbers, expressions, and even strings. This comes at a cost, however: since the size of an element can vary, the calculator has to go through the entire list to get to any specific element. So accessing the last elements of a list is much slower than accessing the beginning. It might be better to use string variables for storing large amounts of data, or split the list up into several variables.

Programs

Programs are also considered variables, on the same level as any other: you can even define a program within another program. They imitate built-in commands, and can even be given parameters. Using the Local command, you can declare local variables that are reset to their old values once a program finishes running.

You can also define functions, which are similar to programs but return a value. Functions have some other limitations, though: they can only use local variables, and can't modify any global aspects of the calculator (so graphical commands, for example, are limited to programs).

With local variables, and the ability to define functions and programs, you can program in a procedural language style. Instead of placing the entire code of the program in one block, you can split it up into functions and subprograms that are defined at the beginning of the main program.

Optimizations

Most types of trivial optimizations from the TI-83 series are invalid on the 68k calculators. For example, closing parentheses, quotes, and brackets are now mandatory. The Ans variable no longer plays an important role: though the ans() command does exist to replace it, it's not modified by storing to variables inside a program, so it's mostly useful on the home screen.

A large part of TI-68k optimization revolves around careful use of lists. List variables are no longer random access: accessing the last element of a list is much slower than accessing the first element. For this reason, going through a list in a For loop is about the worst thing you could do.

Graphics

TI-68k Basic gives the programmer much more options with displaying graphics. Sprites, which had to be displayed using various tricks or libraries on a TI-83 series calculator, are built into TI-68k Basic as picture variables. These picture variables bear little resemblance to the screenshot-like functionality they have on a TI-83+. They can be any size from 1x1 to the entire screen, and can be stored from and recalled to any part of the graph screen. There are even several commands for displaying a sprite using different logic.

Apart from these very powerful commands, more ordinary commands have also been buffed up. Virtually all graphics commands have a point and a pixel equivalent, so you're free to choose one or the other to use (usually, you'll want pixels). The Circle command now draws circles instantaneously, as opposed to taking several seconds.

Instead of being forced to choose between home screen and graph screen, the choice is between graph screen and "Program I/O" screen on the TI-68k calculators. The program I/O screen is a separate home screen for programs, which is limited to text (but the text doesn't have to be aligned). In addition, both screens can be spiced up using dialogs, which imitate the appearance of a popup window on a computer, and are great for inputting data without having to erase anything from the screen.

There is one limit to graphics on the TI-68k calculators - they cannot draw over the top menu bar and bottom status bar, so are effectively limited to only 2/3 of the screen. Assembly libraries can be used to access the entire screen, but this is impossible in TI-Basic alone.

Closing Words

This page gives an overview of some of the features of TI-68k Basic, but it isn't, and cannot, be complete. There are other pages you could visit to get a better picture of 68k programming:

However, the best way to try to learn the language is first-hand experience with it.

Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License