(OP) (LIT) (BRANCH) (BRANCH>) (RESOLVE) (LABEL), entries 6-11: the code generator of any language built on the machine (MACHINE.md 2.1). asm.c's layout rules with text.c's branch placement; 400 random sequences agree word for word with asm.c at both widths, memory-full and out-of-reach are refused on both sides, and a ref with no branch is refused, not looped on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
1.0 KiB
Plaintext
22 lines
1.0 KiB
Plaintext
\ main.f18 -- the ROM's entry table.
|
|
\
|
|
\ docs/v4.0.0/MACHINE.md 2.1. The ROM is shared code: a payload calls its
|
|
\ routines through this table and never to an address inside the ROM, so a
|
|
\ rebuilt ROM breaks no payload. It is at the ROM's base, one jump a word,
|
|
\ in a fixed order that only ever grows at its end. Entry i is at the ROM's
|
|
\ base plus i. DATASHEET-F18.md lists each routine's stack effect.
|
|
|
|
: (ENTRIES)
|
|
jump (KEY) \ 0 ( -- c )
|
|
jump (TOKEN) \ 1 ( -- len )
|
|
jump (NUMBER) \ 2 ( -- n flag )
|
|
jump (FIND) \ 3 ( -- rec | 0 )
|
|
jump (DEFINE) \ 4 ( value kind -- )
|
|
jump (OPCODE) \ 5 ( -- op | -1 )
|
|
jump (OP) \ 6 ( op -- )
|
|
jump (LIT) \ 7 ( v -- )
|
|
jump (BRANCH) \ 8 ( op target -- )
|
|
jump (BRANCH>) \ 9 ( op -- ref )
|
|
jump (RESOLVE) \ 10 ( ref target -- )
|
|
jump (LABEL) \ 11 ( -- addr )
|