The name table is a list of 8 byte entries which define all the names used in SuperBasic (or extensions to SuperBasic written in assembler), the type of each entry and where it lives in the name list and the SuperBasic variables area.
As per the description above (GETTING PARAMETERS), the name table is also used to store details of the parameters passed to our assembly routine. SO for parameters passed, a copy is made and stored at the end of the name table. The A3 and A5 registers are set up to point at the first and last parameter and for these, the format of the name table is as follows :
+-------------------------------------------------------------------+
| Bytes 0 & 1 | Bytes 2 & 3 | Bytes 4 to 7 |
|-------------------------------------------------------------------|
| Type & Separator | Pointer to NAME LIST entry | Pointer to value |
| flag word | MAY BE AN ODD ADDRESS | in variables area |
+-------------------------------------------------------------------+
The low byte of the type word tells us what type of parameter we are dealing with and its separator(s) as follows :
+---------------------------------------------------------------------+
| Bit 7 | 1 = There is a hash (#) in front of this parameter. |
| | 0 = There is not a hash. |
|---------------------------------------------------------------------|
| Bits 6-4 | 000 = No separator after this parameter |
| | 001 = Comma (,) after this parameter |
| | 010 = Semi-colon (;) after this parameter |
| | 011 = Back-slash (\) after this parameter |
| | 100 = Exclamation mark (!) after this parameter |
| | 101 = TO after this parameter |
|---------------------------------------------------------------------|
| Bits 3-0 | 0000 = null |
| | 0001 = string |
| | 0010 = Floating point |
| | 0011 = Integer |
+---------------------------------------------------------------------+
For the first parameter, the type byte is at 1(a6,a3.l) as opposed to 0(a6,a3.l).
For the rest of SuperBasic, the name table uses bytes 0 and 1 to define the type of the entry as follows :
+----------------------------------------------------+
| Byte 0 |
+----------------------------------------------------+
| $00 = Undefined |
| $01 = Expression |
| $02 = Variable |
| $03 = Array or substring |
| $04 = SuperBasic PROCedure (Byte 1 is always zero) |
| $05 = SuperBasic FuNction |
+----------------------------------------------------+
+---------------------------------------+
| Byte 1 |
+---------------------------------------+
| $00 = Substring (Internal use only !) |
| $01 = String |
| $02 = Floating point |
| $03 = Integer |
+---------------------------------------+
+-------------------------------------+
| Both Together |
+-------------------------------------+
| $0602 = REPeat loop identifier |
| $0702 = FOR loop identifier |
| $0800 = Assembly language procedure |
| $0900 = Assembly languge function |
+-------------------------------------+
The REPeat and FOR loop identifiers are hard coded to be of type floating point. This represents the internal values for SuperBasic. I suspect that this is the reason that FOR loop identifiers cannot be integer. I believe that SBASIC allows integer FOR loops and I presume that the internal format for these will be $0703 - I am sure that Jochen will correct me if I am wrong !!
For all entries in the name table, be they parameters of 'proper' names, have a word in bytes 2 & 3 which points to the entry in the name list for this 'name'. This simply gives an easy way of storing the names all in one place. Note that this value is simply the offset from the start of the name table where the bytes of this name can be found. A fuller description of the name list follows on (in the best tradition of upside down magazine articles !) below.
If the value is -1, then this is an expression and has no name.
Finally, there is a long word which is the pointer to the variables area. If this value is negative then the variable is undefined and has no entry there. Again, this value is an offset into the variables area and not an absolute address.