|BAS File Format Description|
| 8 bit unsigned char
WORD - 16bit unsigned short (little endian)
WORD LOMEM WORD VNT WORD VNTE WORD VVT WORD STMTAB WORD STMCUR WORD STARPLOMEM should be always zero - points to page with immediate buffer
VNT - start of variable name table - usually offset $100 from LOMEM
VNTE - end of variable name table
VVT - start of variable values table
STMTAB - start of token area
STMCUR - current line (line 32768)
STARP - end of token area, start of stacks
Variable name tableVariable names are stored in char per char, last is ORed with $80. Sometimes the name area is overwritten with $9B chars (so called unlistable programs).
Variable values table8 bytes per value:
BYTE btType BYTE btNumber - offset to variable name table BYTE data - depends on btTypebtType could be one of:
$00 SCALAR - data is interpreted as Atari BCD
$40 ARRAY undimed - data is interpreted as follows:
WORD STARP offset$41 ARRAY - same as above
$80 STRING undimed - data is interpreted as follows:
WORD STARP offset$81 STRING - same as above
Token areaLine begins with
WORD line number BYTE line length in bytesThen there is one command:
BYTE token len BYTE token byte additional dataTokens 0 & 1 are followed by string ending by $9B.
Then there may be some operands:
0E NCONST 0F SCONST 10 NOUSE 11 NOUSE 12 , 13 $ 14 : 15 ; 16 EOL 17 GOTO 18 GOSUB 19 TO 1A STEP 1B THEN 1C # 1D <= 1E <> 1F >= 20 < 21 > 22 = 23 ^ 24 * 25 + 26 - 27 / 28 NOT 29 OR 2A AND 2B ( 2C ) 2D = 2E = 2F <= 30 <> 31 >= 32 < 33 > 34 = 35 + 36 - 37 ( 38 ( 39 ( 3A ( 3B ( 3C , 3D STR$ 3E CHR$ 3F USR 40 ASC 41 VAL 42 LEN 43 ADR 44 ATN 45 COS 46 PEEK 47 SIN 48 RND 49 FRE 4A EXP 4B LOG 4C CLOG 4D SQR 4E SGN 4F ABS 50 INT 51 PADDLE 52 STICK 53 PTRIG 54 STRIG
NCONST is followed by 6 bytes of Atari BCD number.
SCONST is followed by string data.
If operand has bit 7 set, then it's reference to variable.
000A 0F 0F 36 80 2D 0E 40 10 00 00 00 00 16Output of my ChkBas program:
ChkBas v1.00 (c) 1998-1999 Jindrich Kubec <firstname.lastname@example.org> Latest version can be found at http://www.asw.cz/~kubecj Published under GPL. See GPL.TXT Thanks to Russ Gilbert for his SALVAGE programsBack (c) 1998-2004 Jindroush Last modified: Mon Apr 19 11:14:52 1999