         ====================================================
            The Forth Virtual Engine coded in 8086 and 6809
         ====================================================






----------------------------------------------------------------------------
-------------------------+-------------------------+------------------------
           8086          |          6809           |         Forth
-------------------------+-------------------------+------------------------
:NEXT   LODSW            |      LDX ,Y++           |          NEXT
        MOV BX,AX        |      JMP [,X]           | Executed by about any-
        JMP W[BX]        |                         | thing to pass along ctrl.
-------------------------+-------------------------+------------------------
:NEST   INC BX           |      PSHS Y             |   called  NEST
        INC BX           |      LEAY 2,X           |      or DOCOL .
        DEC BP           |      NEXT               |   Compiled by
        DEC BP           |                         |
        MOV W[BP],SI     |                         |        :
        MOV SI,BX        |                         |
        NEXT             |                         |
-------------------------+-------------------------+------------------------
:UNNEST MOV SI,W[BP]     |      PULY               |   UNNEST, SEMI-S .
        INC BP           |      NEXT               |   compiled by
        INC BP           |(recoding of next pref'd |     ;  and  EXIT
        NEXT             |to JMP -- performance + )|
-------------------------+-------------------------+------------------------







About any entry in the Forth dictionary has the following format :

 +-----------------+-----------------|-----------------+-----------------+
 |    name field   |   link field    |    code field   | parameter field |
 +-----------------+-----------------|-----------------+-----------------+
                                     |
 |<---------- compile time --------->|<----------- run time ------------>|






+----------------+-------------------------------------------------------+
|   part         |            purpose / function                         |
+----------------+-----------------------------------------+-------------+
|   name field   | look up word during compilation or      |             |
|                | calling interactively. Usually one byte | compile     |
|                | more than number of characters in name. |     time    |
|                |                                         |      action |
|   link field   | establishes a link to the previous word |             |
|                | (belonging to the same vocabulary).     |             |
|                | Gives the vocabulary a linked-list      |             |
|                | structure. Usually 16 bit               |             |
| -   -   -   -  |-   -   -   -   -   -   -   -   -   -   -|  -   -   -  +
|            may be seperated here (in seperate-headers systems)         |
| -   -   -   -  |-   -   -   -   -   -   -   -   -   -   -|  -   -   -  +
|   code field   | contains the address of                 |             |
|                | processor-executable code which         |   run time  |
|                | determines the nature of the word       |     action  |
|                | (machine code, hi-level, data etc).     |             |
|                | Usually 16 bit                          |             |
|                |                                         |             |
| parameter field| containing any additional data a word   |             |
|                | requires. Size depends on content,      |             |
|                | ususally between 0 and 20000 bytes      |             |
+----------------+-----------------------------------------+-------------+






Sample definitions    (name- and link fields omitted)



     CODE FIELD             PARAMETER FIELD

                 sample CODE definition   ( "Primitive" )
+-----------------+--------+--------+- - /- -+--------+-----------------+
|    * + 2        |   asm  |   asm  |  asm   |  asm   |  next/jmp next  |
+-----------------+--------+--------+- - /- -+--------+-----------------+




                 sample HILEVEL definition  ( "Colon Word" )
+-----------------+-----------------+-----------------+-----------------+
|  addr of NEST   |     addr        |     addr        | addr of UNNEST  |
+-----------------+-----------------+-----------------+-----------------+
       |                point to any code field                |
       |                                                       |
       |                                          --------------
       |                                          |
       |                                          |
       v                                          v
  +--------+--------+--------+--------+      +--------+--------+--------+
  | PSHS Y |LEAY 2