jonathan n. nall
03.30.96

the .92g format

ok folks, here's the breakdown on the .92g format by texas instruments.

(all numbers in hex)

offset	length	description
00	    0A	    ti header (**TI92** 0x01 0x00)
0B	    08	    i don't know what this stuff is....
12	    22	    comment (this is null terminated)
34	    06	    i don't know what this stuff is either...
3A	    01	    total number of variables (x) in file
				(this number includes folders)
3B	    01	    0x00
3C	    02	    offset of 1st variable
3E	    02	    0x00 0x00


then x lines of the format

01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|_____________________| || |______| |___| ||
	   a	    b     c       d   e

a) variable name (null terminated if less than 8 chars)
b) variable type id (see table below)
c) these 3 bytes are 0x00
d) offset of the end of the variable
e) 0x00

NOTE: if the variable id is 0x1F, that line represents a folder and the line
has the format:

01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|_____________________| || || || || |___| ||
	   a	    b  c  d  e    f   g

a) variable name (null terminated if less than 8 chars)
b) variable type id (0x1F)
c) 0x00
d) number of variables in this folder
e) 0x00
f) offset of 1st variable in this folder
g) 0x00


there are then 2 bytes with the values 0xA5 and 0x5A

and now you should be at the offset given by the bytes at 0x3C. this is where
the data starts. it looks like this (all numbers in hex):

length	description

04	    a doubleword of zeros (00 00 00 00)
02	    length of data (n)
n	     data
02	    checksum (found by adding all bytes of data and the length)

note: if you take the value at 0x3A and subtract the number of variables
with an id of 0x1F you get the number of regular variables (say z).
then there are z entries of the above format left in the file.


table of variable id values

value	type
0x00	   expression
0x04	   list
0x06	   matrix
0x0A	   data
0x0B	   text
0x0C	   string
0x0D	   gdb
0x0E	   fig
0x10	   pic
0x12	   program
0x13	   function
0x14	   macro
0x1F	   folder




