TI-89 Link Protocol Guide - File formats

##

File Formats

The TI-89 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 ".89g" and backups with the extension ".89g" also. However, all of these file types have a common format apart from FLASH files.
Note: TI89/92/92+ have the same common file format.

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

Extension | Extension | Extension | Description
--- | --- | --- | ---
.89a | .9xa | .v2a | TI-89 figure
.89g | .89g | .89g | TI-89 system backup
.89c | .89c | .89c | TI-89 data
.89d | .89d | .89d | TI-89 GDB (Graphic Data Base)
.89e | .89e | .89e | TI-89 expression
.89f | .89f | .89f | TI-89 function
.89g | .89g | .89g | Multiple TI-89 variables of varying types (group)
.89i | .89i | .89i | TI-89 picture (image)
.89k | .89k | .89k | TI-89 FLASH application
.89l | .89l | .89l | TI-89 list
.89m | .89m | .89m | TI-89 matrix
.89p | .89p | .89p | TI-89 program
.89s | .89s | .89s | TI-89 string
.89t | .89t | .89t | TI-89 text
.89u | .89u | .89u | TI-89 Operating System (AMS)
.89x | .89x | .89x | TI-89 macro
.89z | .89z | .89z | TI89 assembly program

###

The TI-89 variable file format

The TI-89 variable file format has three parts: a header, a variable table and a data section.

The header appears at the beginning of the file and takes the following format:
Note - All 2-byte and 4-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 "`**TI89**`".
8 | 2 bytes | 2-byte further signature. These two bytes always contain {01h, 00h} = {1, 0}.
10 (Ah) | 8 bytes | Default folder name (zero terminated unless 8 characters long).
18 (12h) | 40 (28h) bytes | Comment. The comment is either zero-terminated or padded on the right with space characters.
58 (3Ah) | 2 bytes | Number of variable and folder entries in the variable table.

Note: If the first byte of the default folder name is 0, then the default folder is the current folder on the receiving unit.

The variable table comes immediately after the header and consists of a number of 16-byte entries, each taking the format described below. Folder entries share the same table. The variables described before the first folder entry are assumed to be in the default folder. Variables described after any given folder entry are placed in that folder.
If no folder entries are included, then variables are considered to be part of the folder named at file offset 0x0A. If this is null, then it is considered to be in the current directory when a link program sends it.

Each variable entry follows this format:

Offset | Length | Description
--- | --- | ---
0 | 4 bytes | Offset to the data for this variable from the beginning of the file.
4 | 8 bytes | Name of variable (zero terminated if not 8 characters long).
12 (Ch) | 1 byte | Type ID of the variable.
13 (Dh) | 1 byte | Attribute (0: none, 1: locked, 2: archived)
14 (Eh) | 2 bytes | Unused - each byte has a value of 0.

Folder entries follow this format:

Offset | Length | Description
--- | --- | ---
0 | 4 bytes | Offset to the data for the next variable from the beginning of the file.
4 | 8 bytes | Name of variable (zero terminated if not 8 characters long).
12 (Ch) | 1 byte | Type ID of the variable. For folders, this value is always 1Fh.
13 (Dh) | 1 byte | Unused - this byte has a value of 0.
14 (Eh) | 2 bytes | The number of variables in this folder.

Finally, the data section, which follows the variable table, has this format:

Offset | Length | Description
--- | --- | ---
0 | 4 bytes | The file size, in bytes.
4 | 2 bytes | A 2-byte signature. These two bytes always contain {A5h, 5Ah}.
6 | n bytes | Data section.

The data section consists of several variable data parts back-to-back, in order of their listing in the variable table. Each variable part has this format:

Offset | Length | Description
--- | --- | ---
0 | m bytes | The variable data. This field includes all bytes transferred in data packets. The first five bytes usually all have a value of 0.
m | 2 bytes | Checksum. This is the lower 16 bits of the sum of all bytes in the first four bytes and the variable data.

###

A simplification of the TI-89 file format for a single variable

Files containing single variables are a simple yet common example of the TI-89 file format. In this special case, the file format can be simplified as follows:

Offset | Length | Description
--- | --- | ---
0 | 8 bytes | 8-character signature. The signature is always "`**TI89**`".
8 | 2 bytes | 2-byte further signature. These two bytes always contain {01h, 00h} = {1, 0}.
10 (Ah) | 8 bytes | The parent folder of the variable (zero terminated if not 8 characters long) - See note below.
18 (12h) | 40 (28h) bytes | Comment. The comment is either zero-terminated or padded on the right with space characters.
58 (3Ah) | 6 bytes | These 6 bytes always contain {01h, 00h, 52h, 00h, 00h, 00h} = {1, 0, 82, 0, 0, 0}.
64 (40h) | 8 bytes | The name of the variable (zero terminated if not 8 characters long).
72 (48h) | 1 byte | The type ID for this variable.
73 (49h) | 3 bytes | These three bytes always have a value of 0.
76 (4Ch) | 4 bytes | The file size, in bytes.
80 (50h) | 2 bytes | A 2-byte signature. These two bytes always contain {A5h, 5Ah}.
82 (52h) | n bytes | The variable data. This field includes all bytes transferred in data packets. The first four bytes usually all have a value of 0.
82 (52h)+n | 2 bytes | Checksum. This is the lower 16 bits of the sum of all bytes in the variable data.

Note: If the first byte of the name of the parent folder is 0, then the variable is put into the current folder on the receiving unit.

###

The TI-89 backup file format

The TI-89 does not have a true backup capability. Indeed, a backup file is simply a group file and have the .89g file extension.
Nethertheless, backup files get with the TIGL software does not keep the attribute of the variable (locked or archived). So, if a backup with previously archived variables is sent to the calc, the variables will not be archived and a 'Not enough memory' may occur !
But, TiLP supports a slightly modified .89g file format which allow to keep this attribute. This enhanced group file format is 100% fully compatible with the TIGL software.

The only modification (in italic) has been made on the variable entry format:

Offset | Length | Description
--- | --- | ---
0 | 4 bytes | Offset to the data for this variable from the beginning of the file.
4 | 8 bytes | Name of variable (zero terminated if not 8 characters long).
12 (Ch) | 1 byte | Type ID of the variable.
13 (Dh) | 1 bytes | Attribute: 1Dh (none), 26h (locked) or 27h (archived)
14 (Eh) | 2 bytes | Unused - each byte has a value of 0.

###

The TI-89 FLASH file format

A FLASH file usually contains between 1 and 3 headers with data and the header has the same format than the TI83+ one.
Headers can contain : license or data (app/os/certificate).

The header takes the following format:
Note - All 2-byte and 4-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 "`**TIFL**`".
8 | 2 bytes | Revision number (BCD coded): major.minor.
9 | 1 byte | Flags (usually set to 00h).
10 (Ah) | 1 byte | Object type (00h).
12 (Ch) | 4 bytes | Binary-Coded-Decimal date such as {dd, mm, yy, yy} for 'dd/mm/yyyy'.
16 (10h) | 1 bytes | Name length
17 (11h) | 8 bytes | Application name or 'basecode' for OS or '' for certificate. Name is null-terminated unless 8 characters long.
25 (19h) | 23 bytes | Filler (unused, set to 00h).
48 (30h) | 1 byte | Device type (TI73: 74h, TI83+: 73h, TI89: 98h, TI92+: 88h)
49 (31h) | 1 byte | Data type (os: 23h, application: 24h, certificate: 25h, license: 3Eh)
50 (32H) | 22 bytes | Filler (unused, set to 00h).
72 (48h) | 2 bytes | Hardware ID (1 = 92+, 3 = 89, 8 = V200, 9 = Titanium); see TIGCC doc.
74 (4Ah) | 4 bytes | Size of data in bytes
78 (4Eh) | n bytes | Data.
78 (4Eh)+n | 2 bytes | Checksum. This is the lower 16 bits of the sum of all bytes in the variable data.

The data section contains pure raw data which are directly sent to the calculator.

There is an old format, called TIB but still used by developers. Its format is below: The document comes from PedRom sources and is copyrighted as GPL by Patrick Pelissier.

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)