c23bee740dcee51e2d91f95f1c6691baa0c5d68d
[rrq/jonasforth.git] / notes
1 FASM:
2 - https://flatassembler.net/docs.php?article=fasmg (Introduction)
3 - https://flatassembler.net/docs.php?article=fasmg_manual (Manual)
4 - https://flatassembler.net/docs.php?article=manual (Other manual)
5
6 JONESFORTH:
7 - https://github.com/nornagon/jonesforth/blob/master/jonesforth.S
8
9 # Notes on implementation
10
11 ## Dictionary
12
13 In Forth, words are stored in a dictionary. The dictionary is a linked list whose entries look like this:
14     +------------------------+--------+---------- - - - - +----------- - - - -
15     | LINK POINTER           | LENGTH/| NAME              | DEFINITION
16     |                        | FLAGS  |                   |
17     +--- (4 bytes) ----------+- byte -+- n bytes  - - - - +----------- - - - -
18 For example, DOUBLE and QUADRUPLE may be stored like this:
19       pointer to previous word
20        ^
21        |
22     +--|------+---+---+---+---+---+---+---+---+------------- - - - -
23     | LINK    | 6 | D | O | U | B | L | E | 0 | (definition ...)
24     +---------+---+---+---+---+---+---+---+---+------------- - - - -
25        ^       len                         padding
26        |
27     +--|------+---+---+---+---+---+---+---+---+---+---+---+---+------------- - - - -
28     | LINK    | 9 | Q | U | A | D | R | U | P | L | E | 0 | 0 | (definition ...)
29     +---------+---+---+---+---+---+---+---+---+---+---+---+---+------------- - - - -
30        ^       len                                     padding
31        |
32        |
33   LATEST
34 The Forth variable LATEST contains a pointer to the most recently defined word.
35