BASIC file formats
BASIC programs written for TI BASIC and Extended BASIC are not stored as plain text in memory. This is different with assembler programs which are edited as text files and then assembled to a Tagged Object Code file.
This is not appropriate for BASIC. When the program is started, and it would be stored as plain text, the BASIC interpreter would have to parse the line first, finding out the commands and the arguments, and then execute it. This is typical for script languages of today, but it would be just too slow, and we know well that TI BASIC and Extended BASIC are quite slow, compared with other platforms.
BASIC lines are tokenized. For each command or special character or character sequence that has a meaning in BASIC there is a one-byte code, the token. Example:
Command | Token (hex) |
---|---|
NEW | 00 |
SAVE | 07 |
EDIT | 09 |
9c | |
& | b8 |
"..." (quoted string) | c7 |
SEG$ | d8 |
VALIDATE | fe |
You can find a complete table here.
TODO: continue