commit 3ec9e14a32294b17a620d2ce62d227da65cba55a
parent 4ca8e8cddc10d339f4f23983061b379dc91c8669
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Thu, 9 Mar 2023 18:10:52 -0500
HAL: we have prompt
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/xcomp/bootlo.fs b/fs/xcomp/bootlo.fs
@@ -246,8 +246,9 @@ create _escapes 'n' c, 'r' c, '0' c,
create _repl LF c, CR c, 0 c,
: "< ( -- c )
in< dup '"' = if drop -1 else dup '\' = if
- drop in< _escapes 3 [c]? dup 0>= if _repl + c@ else drop then then then ;
-'0' _escapes 3 [c]? dbg bye
+ drop in< dup _escapes 3 [c]? dup 0>= if nip _repl + c@ else drop then
+ then then ;
+: ," begin "< dup -1 <> while c, repeat drop ;
code (s) r@ W>A, W) 8b @, 1 W+n, RSP) +, rdrop W<>A, branchA,
: S" ( comp: -- ) ( not-comp: -- str )
compiling if compile (s) else here then
@@ -255,6 +256,7 @@ code (s) r@ W>A, W) 8b @, 1 W+n, RSP) +, rdrop W<>A, branchA,
: ."
compiling if [compile] S" compile stype else
begin "< dup 0>= while emit repeat drop then ; immediate
+: prompt ." hello HAL!\n" ; prompt bye
: abort" [compile] ." compile abort ; immediate
: word" [compile] S" NEXTWORD litn compile ! ; immediate