TI-86 Link Protocol Guide v1.0 - Tokens and Character Codes

##

Tokens and Character Codes

### TI-86 Tokens

In order to save space and execution time, the TI-86 tokenizes all BASIC programs and equations before running or evaluating them. Rather than trying to interpret multiple-character command names in real-time, all simple commands are compressed down to one or two bytes. All possible tokens that can exist in a program are shown below. Blue-colored squares link to a note describing the token's function. Red-colored squares link to a separate table of two-byte tokens starting with the original byte (3Dh or 8Eh). Black-colored squares have no known function.

TI-86 Tokens | Least Significant Digit
--- | ---
Most Significant Digit |  | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F
0 |  | Rec | Pol | Cyl | Sph | DMS | Bin | Hex | Oct | Dec | Frac |  | [ | ] | { | }
1 | ( | ) | round | max | min | mod | cross | dot | aug | rSwap | rAdd | multR | mRAdd | sub | lcm | gcd
2 | simult | inter | pEval | randM | seq | evalF | fnInt | arc | fMin | fMax | der1 | der2 | nDer | note 1 |  | ,
3 | or | xor | note 2 | note 3 | note 3 | note 3 | note 3 | note 3 | note 3 | note 3 | note 3 | note 2 | note 2 | more | note 4 | =
4 | and | rand |  | getKy | note 5 | % | ! | r | ° | -1 | 2 | T | Menu | P2Reg | P3Reg | P4Reg
5 | == | < | > |  |  |  | Radian | Degree | Normal | Sci | Eng | Float | Fix | RectV | CylV | SphereV
6 | + | - | Func | Param | Pol | DifEq | Bin | Oct | Hex | Dec | RectC | PolarC | dxDer1 | dxNDer | : | note 6
7 | * | / | SeqG | SimulG | PolarGC | RectGC | CoordOn | CoordOff | DrawLine | DrawDot | AxesOn | AxesOff | GridOn | GridOff | LabelOn | LabelOff
8 | nPr | nCr | Trace | ClDrw | ZStd | ZTrig | ZFit | ZIn | ZOut | ZSqr | ZInt | ZPrev | ZDecm | ZRcl | more | DrawF
9 | FnOn | FnOff | StPic | RcPic | StGDB | RcGDB | Line | Vert | PtOn | PtOff | PtChg | Shade | Circl | Axes | TanLn | DrInv
A |  | - | abs | iPart | fPart | int | ln | e^ | log | 10^ | sin | sin-1 | cos | cos-1 | tan | tan-1
B | sinh | sinh-1 | cosh | cosh-1 | tanh | tanh-1 | sign | det | ident | unitV | norm | rnorm | cnorm | ref | rref | dim
C | dimL | sum | prod | sortA | sortD | livc | vcli | lngth | conj | real | imag | angle | not | rotR | rotL | shftR
D | shftL | eigVl | eigVc | cond | poly | fcstx | fcsty | eval | If | Then | Else | While | Repeat | For | End | Return
E | note 7 | note 8 | Pause | Stop | IS> | DS< | Input | Prompt | InpSt | Disp | DispG | Outpt | ClLCD | EqSt | StEq | Fill
F | ^ |  | Solver | OneVar | LinR | ExpR | LnR | PwrR | ShwSt | Hist | xyLine | Scatter | SortX | SortY | LU |

3D XX Tokens | Least Significant Digit (second byte)
--- | ---
Most Significant Digit |  | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F
0 | zxScl | zyScl | xScl | yScl | xMin | xMax | yMin | yMax | tMin | tMax | tStep | Step | ztStep | zStep | tPlot | Min
1 | Max | zxMin | zxMax | zyMin | zyMax | ztPlot | zMin | zMax | ztMin | ztMax | lower | upper | x | y | xFact | yFact
2 | difTol | tol |  | Na | k | Cc | ec | Rc | Gc | g | Me | Mp | Mn | µ0 | 0 | h
3 | c | u | e | xStat | yStat | fStat | TblStart | Tbl | fldRes | EStep | dTime | xRes | zxRes | FldPic |  |

8E XX Tokens | Least Significant Digit (second byte)
--- | ---
Most Significant Digit |  | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F
0 | PxOn | PxOff | PxChg | Get | Send | SinR | LgstR | TwoVar | GrStl | DrEqu | LCust | Form | Select | PlOn | PlOff | ClrEnt
1 | StReg | IAsk | IAuto | Text | Horiz | DispT | ClTbl | DelVar | Box | MBox | ClrLsts | FldOff | DirFld | SlpFld | SetLEdit | Plot1
2 | Plot2 | Plot3 | RK | Euler | ZData | Asm | AsmComp | note 9 | note 10 | note 11 | PxTest | randInt | randBin | randNorm | median | cSum
3 | cSum | Deltalst |  |  |  |  |  |  |  |  |  |  |  |  |  |

#### Notes:

- Note 1: Token 2Dh is an opening quote. A zero-terminated literal character string immediately follows token 2D, and the terminating zero acts as the closing quote. Example: "Hi" would be tokenized {2Dh, 48h, 69h, 00h}
- Note 2: Tokens 32h, 3Bh, and 3Ch are variable-name tokens. The first byte after the token is a name-length byte. Following that is a literal character string (not zero-terminated) representing the name of the variable.

  Token 32h is used for the y-variables Q1 ... Q9, QI1 ... QI9, r, t, x, y and .

  Token 3Bh is used for the y-equations y1 ... y99, xt1 ... xt99, yt1 ... yt99, r1 ... r99 and Q'1 ... Q'9.

  Token 3Ch is used for the statistical variables a, b, corr, maxX, maxY, Med, minX, minY, n, PRegC, Qrtl1, Qrtl3, RegEq, Sx, Sy, x, y, x, x2, xy, y, y2, tolMet, and .

- Note 3: Tokens 33h - 3Ah are 1- to 8-character variable name tokens, respectively. A literal character string follows (not zero-terminated).
- Note 4: Token 3Eh is the conversion token. Following the token is the name-length byte for the original unit, then a literal character string representing the unit's name. Following that is the name-length byte for the new unit, then a literal character string representing the new unit's name. Neither name is zero-terminated.
- Note 5: Token 44 is a literal-number token. Following the token is a zero-terminated literal character string that represents the number. Valid characters are the digits 0-9; the hexadecimal digits A-F; base descriptors b, h, o, and d; the period; the negation character and the exponent (E) character.
- Note 6: Token 6F is the carriage-return token.
- Note 7: Token E0 is the Lbl token. Following the token is a zero-terminated literal character string representing the label name.
- Note 8: Token E1 is the Goto token. Following the token is a zero-terminated literal character string representing the label name.
- Note 9: Token 8Eh 27h is the AsmPrgm token. Everything that follows the token is a literal ASCII character. Valid characters are the digits 0..9, the letters A..F and the hard return character (D6h).
- Note 10: Token 8Eh 28h is the Compiled Assembly token. It is the first and only token in a compiled assembly-language program. Everything that follows is binary Z80 machine code.
- Note 11: Token 8Eh 29h is the Edit-Lock token. It is the first token in a program that cannot be edited.

### TI-86 Character Codes

The TI-86 follows the ASCII standard for normal printable characters - those in the range 32 (20h) to 126 (7Eh). All other possible characters take the place of control characters (0 to 31) and extended ASCII characters (127 to 255).

All characters and their character codes in the TI-86 6x8-pixel home screen font are shown here:

All characters and their character codes in the TI-86 6x6-pixel menu font are shown here:

File Formats | Table of Contents |

Site maintained by Romain Liévin ( roms@lpg.ticalc.org ) and Tim Singer ( tsinger@gladstone.uoregon.edu )