TI-86 Link Protocol Guide v1.0 - File formats

##

File Formats

The TI-86 Graph Link software stores variables in several types of files. Single variables are stored in files that have an extension that corresponds with their type. Groups of variables are stored in files with the extension ".86g". However, all of these file types have a common format.

The different file types and contents that the TI-86 Graph Link software can read and write are shown below.

Extension | Description
--- | ---
.86c | TI-86 complex number
.86d | TI-86 GDB (function, polar, parametric or differential equation)
.86e | TI-86 equation
.86g | Multiple TI-86 variables of varying types (group)
.86i | TI-86 picture (image)
.86k | TI-86 constant (real or complex)
.86l | TI-86 list (real or complex)
.86m | TI-86 matrix (real or complex)
.86n | TI-86 real number
.86p | TI-86 program
.86s | TI-86 string
.86v | TI-86 vector
.86w | TI-86 window settings (Func, Pol, Param, DifEq or ZSTO)

### The TI-86 variable file format

The TI-86 variable file format has two parts: a header and several variable entries.

The header appears at the beginning of the file and takes the following format:
Note - All 2-byte integers are stored little-endian Intel-style (least significant byte first).

Offset | Length | Description
--- | --- | ---
0 | 8 bytes | 8-character signature. The signature is always "`**TI86**`".
8 | 3 bytes | 3-byte further signature. These three bytes always contain {1Ah, 0Ah, 00h} = {26, 10, 0}
11 (Bh) | 42 (2Ah) bytes | Comment. The comment is either zero-terminated or padded on the right with space characters.
53 (35h) | 2 bytes | Length, in bytes, of the data section of the file. This number should be 57 (39h) bytes less than the file size.
55 (37h) | n bytes | Data section - consists of a number of variable entries (described below).
55 (37h)+n | 2 bytes | File checksum. This is the lower 16 bits of the sum of all bytes in the data section.

Each variable entry follows this format:

Offset | Length | Description
--- | --- | ---
0 | 2 bytes | Always has a value of 12 (Ch).
2 | 2 bytes | Length, in bytes, of the variable data.
4 | 1 byte | variable type ID byte (see variable type ID's)
5 | 1 byte | Length, in characters, of the variable name
6 | 8 bytes | Variable name, padded with space characters (0x20) on the right. (*)
14 (Eh) | 2 bytes | Length, in bytes, of the variable data. (This is a copy of the value in offset 2)
16 (10h) | n bytes | Variable data. Click here for variable data formats.

(*) Note of Adrian Mettler (TiLP bug #837114) :

    There are in fact at least THREE conventions for storing variable names in TI-86 files in the wild, and affect all
    variable types. These are the "official" one generated by the current version of TI's software (and documented in the
    references that I've seen online), a slight modification of this format, and the third one, closer to the wire format,
    that is created by some third-party programs (and perhaps by old versions of TI's own software and by TI85). All three are
    correctly read by TI's software without complaint.

    The difference between the three versions is that TI's official version (1) always includes padding of the name
    field up to 8 characters, using spaces ('\20') for the extra characters.  A common variant (2), currently written by
    TiLP, uses null characters ('\0') to pad up to eight characters.  The third variant (3) DOES NOT pad at all (aka TI-85 format).
    The fourth variant (4) always contains 8 chars but with garbage (eg 03  BE 61 69 70 31 20 20 20).

    The current release of TiLP correctly reads files that follow conventions (1) and (2), and gets really confused on
    files of type (3) and (4).

### A Proprietary TI-86 backup file format

Even if the TI-86 Graph Link software does not support system backups for TI85/86 calculators, this functionnality is implemented in the calculator OS. In this way, it's possible to download and save system backups with the extension ".86b".

This is the reason why FastLink and TiLP have their own file format.

FastLink uses this file format for TI-86 backups:

Offset | Length | Description
--- | --- | ---
0 | 8 bytes | 8-character signature. The signature is always "`**TI86**`".
8 | 3 bytes | 3-byte further signature. These three bytes always contain {1Ah, 0Ah, 00h} = {26, 10, 0}
11 (Bh) | 42 (2Ah) bytes | Comment. The comment is either zero-terminated or padded on the right with space characters.
53 (35h) | 2 bytes | Length, in bytes, of the backup header and the first data section. This number should be 16 (10h) bytes more than the length of the first data section as reported in the backup header.
55 (37h) | 16 bytes | The backup header (format described below).
71 (47h) | x bytes | First data section.
71 (47h)+x | 2 bytes | First checksum. This is the lower 16 bits of the sum of all bytes in the backup header and the first data section.
73 (49h)+x | 2 bytes | Length, in bytes, of the second data section
75 (4Bh)+x | y bytes | Second data section.
75 (4Bh)+x+y | 2 bytes | Second checksum. This is the lower 16 bits of the sum of all bytes in the second data section.
77 (4Dh)+x+y | 2 bytes | Length, in bytes, of the third data section
79 (4Fh)+x+y | z bytes | Third data section
79 (4Fh)+x+y+z | 2 bytes | Third checksum. This is the lower 16 bits of the sum of all bytes in the third data section, or 0 if the third data section is empty (has length 0).
81 (51h)+x+y+z | 2 bytes | Length, in bytes of the fourth data section
83 (53h)+x+y+z | w bytes | Fourth data section.
83 (53h)+x+y+z+w | 2 bytes | Fourth checksum. This is the lower 16 bits of the sum of all bytes in the fourth data section.

The Backup Header has the following format:

Offset | Length | Description
--- | --- | ---
0 | 2 bytes | Offset to data length: Always has a value of Ch (12).
2 | 2 bytes | Length, in bytes, of the first data section.
4 | 1 byte | Type ID: Always has a value of 1Dh.
5 | 1 byte | Length, in characters, of the name: Always has a value of 6.
6 | 8 bytes | Name: "SYSTEM" padded with space characters (20h) on the right.
14 (Eh) | 2 bytes | Length, in bytes, of the first data section.

TiLP uses this file format for TI-86 backups:

This format is based on a TI85 backup format which has been extended for adding a fourth section.

Offset | Length | Description
--- | --- | ---
0 | 8 bytes | 8-character signature. The signature is always "`**TI86**`".
8 | 3 bytes | 3-byte further signature. These three bytes always contain {1Ah, 0Ah, 00h} = {26, 10, 0}
11 (Bh) | 42 (2Ah) bytes | Comment. The comment is either zero-terminated or padded on the right with space characters.
53 (35h) | 2 bytes | Length, in bytes, of the backup header and the data sections. This number should be 17 (11h) bytes more than the sum of the lengths of the three data sections as reported in the backup header.
55 (37h) | 11 bytes | The backup header (format described below).
66 (42h) | 2 bytes | Length, in bytes, of the first data section.
68 (44h) | x bytes | First data section.
68 (44h)+x | 2 bytes | Length, in bytes, of the second data section
70 (46h)+x | y bytes | Second data section.
70 (46h)+x+y | 2 bytes | Length, in bytes, of the third data section
72 (48h)+x+y | z bytes | Third data section
72 (48h)+x+y+z | 2 bytes | Length, in bytes, of the fourth data section (optional)
74 (4Ah)+x+y+z | w bytes | Fourth data section (optional)
74 (4Ah)+x+y+z+w | 2 bytes | Checksum. This is the lower 16 bits of the sum of all bytes in the backup header and data sections.

The backup header has this format:

Offset | Length | Description
--- | --- | ---
0 | 2 bytes | Offset to data length: Always has a value of 9.
2 | 2 bytes | Length, in bytes, of the first data section.
4 | 1 byte | Type ID: Always has a value of 15 (Fh).
5 | 2 bytes | Length, in bytes, of the second data section.
7 | 2 bytes | Length, in bytes, of the third data section.
9 | 2 bytes | Memory address of the second data section
11 | 2 bytes | Length, in bytes, of the fourth data section.

Variable Formats | Table of Contents | Tokens and Characters

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