QDOS Internals

Anything you never knew you wanted to know about the Sinclair QL.

User Tools

Site Tools


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
$0001Unset stringvv
$0002Unset fpvv
$0003Unset integervv
$0101String expressionms
$0102Fp expressionms
$0103Integer expressionms
$0202Fp numbervv
$0301String arrayvv
$0302Fp arrayvv
$0303Integer arrayvv
$0400SuperBASIC procedureln
$0501SuperBASIC string functionln
$0502SuperBASIC fp functionln
$0503SuperBASIC integer functionln
$0602REPeat loop indexvv
$0702FOR loop indexvv
$0800Machine code procedureab
$0900Machine code functionab


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 6SeparatorBits 0 to 3Type
%010;%0010Floating Point
qdosmsq/sbinternal/nametab.txt · Last modified: 2009/02/10 14:58 by george.gwilt