collapseos/apps/forth
Virgil Dupras 80ab395823 forth: Simplify execution model
Change the mainloop so that words are executed immediately after they're read.
This greatly simplifies execution model and allow the "DEFINE" word to become
an IMMEDIATE and stop its "copy from compiled words" scheme.

The downside to this is that flow control words no longer work when being used
directly in the input buffer. They only work as part of a definition.

It also broke "RECURSE", but I've replaced it with "BEGIN" and "AGAIN".

Another effect of this change is that definitions can now span multiple lines.

All in all, it feels good to get rid of that COMPBUF...
2020-03-15 22:46:17 -04:00
..
README.md apps/forth: new (WIP) application 2020-03-07 12:13:15 -05:00
core.fth forth: Simplify execution model 2020-03-15 22:46:17 -04:00
dict.asm forth: Simplify execution model 2020-03-15 22:46:17 -04:00
dictionary.txt forth: Simplify execution model 2020-03-15 22:46:17 -04:00
glue.asm forth: add number literals support 2020-03-07 19:25:55 -05:00
main.asm forth: Simplify execution model 2020-03-15 22:46:17 -04:00
stack.asm forth: Forth-ify RECURSE 2020-03-13 16:40:55 -04:00
util.asm forth: Simplify execution model 2020-03-15 22:46:17 -04:00

README.md

Forth

WIP A Forth interpreter. Far from complete, but you can do stuff like

KEY EMIT KEY EMIT

See dictionary.txt for a word reference.