From: Jonas Hvid Date: Sun, 8 Dec 2019 20:51:08 +0000 (+0100) Subject: Define ':' and ';' in Forth X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=c4dd16293a71e782e36f795d302bf944056ffd4c;p=rrq%2Fjonasforth.git Define ':' and ';' in Forth --- diff --git a/Makefile b/Makefile index 5832cb6..786399f 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +.PHONY: run +run: main + cat sys.f - | ./main + main: main.asm impl.asm fasm $< $@ diff --git a/main.asm b/main.asm index 2e880d9..67e9a7b 100644 --- a/main.asm +++ b/main.asm @@ -527,7 +527,7 @@ forth IMMEDIATE, 'IMMEDIATE', 1 dq LIT, 1 dq LATEST, GET dq LIT, 8, PLUS - dq PUT + dq PUT_BYTE dq EXIT ;; Given the address of a word, return 0 if the given word is not immediate. diff --git a/sys.f b/sys.f new file mode 100644 index 0000000..bc9dae9 --- /dev/null +++ b/sys.f @@ -0,0 +1,11 @@ +S" :" CREATE ] DOCOL + READ-WORD CREATE + LIT DOCOL , + ] +EXIT [ + +: ; + LIT EXIT , + [ S" [" FIND >CFA , ] + EXIT +[ IMMEDIATE