In Paul Santa-Maria's disassembly of Integer BASIC (text version), you can see the syntax table split into two parts, SYNTABL
and SYNTABL2
. I've seen references to the tokens being stored in reverse order, and indeed, the characters within a token are in reverse order, and the tokens themselves are counted down from the ends of the tables.
What is the exact format of the syntax tables? There are a bunch of extra bytes littered around, I believe to store different versions of tokens (eg. PRINT, PRINT <string>, PRINT <expression>), and some of the tokens lack extra bytes: some of them use char+32 vs char-32 to signal the first character, but again, some don't. And some that do also have extra bytes. In addition, SYNTABL2
ends with some extra bytes (are they usually skipped?) and SYNTABL
starts with some apparently unused tokens, then some extra bytes of its own.
Is there a clear description somewhere?
Context: I started out looking at the code because I'm trying to follow the exact rules for adding whitespace when rendering Integer BASIC listings to text. But now I'm intrigued.