diff --git a/ueforth/Makefile b/ueforth/Makefile index b6f0922..c990d60 100644 --- a/ueforth/Makefile +++ b/ueforth/Makefile @@ -40,7 +40,11 @@ out/web/ueforth.js: \ out/posix: mkdir -p out/posix -out/posix/ueforth: posix/posix_main.c common/opcodes.h | out/posix +out/posix/ueforth: \ + posix/posix_main.c \ + common/opcodes.h \ + common/core.h \ + out/gen/boot.h | out/posix $(CC) $(CFLAGS) $< -o $@ $(LIBS) out/arduino: diff --git a/ueforth/common/boot.fs b/ueforth/common/boot.fs index 6e16064..e3b42ff 100644 --- a/ueforth/common/boot.fs +++ b/ueforth/common/boot.fs @@ -118,12 +118,13 @@ variable hld : ? ( a -- ) @ . ; ( Strings ) -: $. r@ dup cell+ swap @ type r> dup @ aligned + cell+ >r ; -: ." [char] " parse postpone $. dup , 0 do dup c@ c, 1+ loop drop align ; immediate -: $@ r@ dup cell+ swap @ r> dup @ aligned + cell+ >r ; -: s" [char] " parse postpone $@ dup , 0 do dup c@ c, 1+ loop drop align ; immediate -: z$@ r@ cell+ r> dup @ aligned + cell+ >r ; -: z" [char] " parse postpone z$@ dup 1+ , 0 do dup c@ c, 1+ loop drop 0 c, align ; immediate +: parse-quote ( -- a n ) [char] " parse ; +: $place ( a n -- ) 0 do dup c@ c, 1+ loop drop 0 c, align ; +: $@ r@ dup cell+ swap @ r> dup @ 1+ aligned + cell+ >r ; +: s" parse-quote state @ if postpone $@ dup , $place + else dup here swap >r >r $place r> r> then ; immediate +: ." postpone s" state @ if postpone type else type then ; immediate +: z" postpone s" state @ if postpone drop else drop then ; immediate ( Examine Dictionary ) : >name ( xt -- a n ) 3 cells - dup @ swap over aligned - swap ;