The header structure in Fleet Forth consists of an optional view field, a link field, a name field, a code field, and a parameter field. The view field is created when the variable VIEW is true. Kernel words do not have a view field. The link field of a word points to the link field of the previous word in the vocabulary. The first word in a vocabulary, any vocabulary, has its link field set to zero. The first byte of the name field has the most significant bit set high. The next two bits in the first byte are the immediate bit and the smudge bit. the least significant five bits hold the length of the name for a maximum name length of 31. each character in the name has its most significant bit set to zero except the last. The last character in the name has its most significant bit set to one. having the MSB's of the first and last bytes in the name set to one facilitates traversal of the name field by the word TRAVERSE. This means that Fleet Forth is case insensitive.
Code: Select all
Structure of a word in the dictionary ( ALLOT shown )
+---------------+ Optional view field for user defined words
| | no system word has a view field
+---------------+ Link field points to link field of previous
| $1B9D | word in the dictionary
+---------------+ Name field length/flags byte
[1] | High bit set for traverse
| [0] | Immediate bit
| [0]_________| Smudge bit
| [ 5 ] Name length 0..31
+---------------+ Name field first letter
[0] | High bit zero
| A |
+---------------+
[0] |
| L |
+---------------+
[0] |
| L |
+---------------+
[0] |
| O |
+---------------+ Name field last letter
[1] | High bit set for traverse
| T |
+---------------+ Code field
| $2369 |
+-------------+-+ Parameter field
| |
The first cell of a vocabulary contains a pointer to the link field of the latest word in that vocabulary or zero if no words have been added to that vocabulary. The second cell of a vocabulary contains a pointer to its parent vocabulary. The Forth vocabulary's second cell holds a zero. The third cell of a vocabulary is part of the VOC-LINK chain used by FORGET.
Code: Select all
Vocabulary structure ( new kernel's FORTH vocabulary shown )
+---------------+
| $249A | Code field points to dovocabulary
+-------------+-+
| $2F21 | Pointer to latest name in vocabulary
+---------------+
| $0000 | Pointer to parent vocabulary
+---------------+
| $0000 | Pointer to previously defined vocabulary's 3rd cell
+---------------+ ( part of the VOC-LINK chain )
Newly created vocabulary ( ASSEMBLER vocabulary when it was first created )
+---------------+
| $249A | Code field points to dovocabulary
+-------------+-+
| $0000 | Pointer to latest name in vocabulary
+---------------+
| $24C7 | Pointer to parent vocabulary ( FORTH )
+---------------+
| $24CB | Pointer to previously defined vocabulary's 3rd cell
+---------------+ ( part of the VOC-LINK chain )