SuperBASIC Name Table
The Name Table consists of a set of eight bytes each in the following form.
The first word is a code giving the Type. This is followed by another word which is the offset from the start of the Name List to the associated name, or -1 if there is no associated name, which is the case for an expression and a substring. Finally there is a long word containing a value pointer which can be one of four things.
- Offset into the variables area (vv).
- Pointer to the maths stack (ms).
- SuperBASIC line number held in the high word (ln).
- Absolute address (ab).
Type | Meaning | Value pointer |
---|---|---|
$0001 | Unset string | vv |
$0002 | Unset fp | vv |
$0003 | Unset integer | vv |
$0101 | String expression | ms |
$0102 | Fp expression | ms |
$0103 | Integer expression | ms |
$0201 | String | vv |
$0202 | Fp number | vv |
$0203 | Integer | vv |
$0300 | Substring | vv |
$0301 | String array | vv |
$0302 | Fp array | vv |
$0303 | Integer array | vv |
$0400 | SuperBASIC procedure | ln |
$0501 | SuperBASIC string function | ln |
$0502 | SuperBASIC fp function | ln |
$0503 | SuperBASIC integer function | ln |
$0602 | REPeat loop index | vv |
$0702 | FOR loop index | vv |
$0800 | Machine code procedure | ab |
$0900 | Machine code function | ab |
Parameters
When a machine code routine is called the parameters are put into the Name Table. In this case the Type code contains information about the parameters.
Bit 7 is set if the parameter is preceded by # (hash). Bits 4 to 6 contain the Separator type and bits 0 to 3 contain the Type of item.
Bits 4 to 6 | Separator | Bits 0 to 3 | Type |
---|---|---|---|
%000 | None | %0000 | Null |
%001 | , | %0001 | String |
%010 | ; | %0010 | Floating Point |
%011 | \ | %0011 | Integer |
%100 | ! | ||
%101 | TO |