From 8a6503cd7fa89424f0deac1a20e6cd1aa4899cd7 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 2 Jan 2025 21:17:54 -0500 Subject: move more words to forth --- core.fth | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core.fth') diff --git a/core.fth b/core.fth index fcd4375..1091b2d 100644 --- a/core.fth +++ b/core.fth @@ -1,9 +1,14 @@ + : ['] ' postpone literal ; immediate : if ['] _jmp0 , here 0 , ; immediate : then here swap ! ; immediate : else ['] _jmp , here 0 , swap here swap ! ; immediate +\ : postpone _parse _get +\ dup cell+ @ 256 and if +\ >xt , else ['] _lit , >xt , ['] , , then ; immediate + : _msb [ 1 cell 8 * 1- lshift ] literal ; : 2/ dup 1 rshift swap 0< if _msb or then ; @@ -82,6 +87,11 @@ >r 2dup c! char+ r> 1- repeat 2drop drop ; +: source tib 0 begin 2dup + c@ while 1+ repeat ; +: find dup count _get dup if + nip dup >xt swap cell+ @ 256 and if 1 else -1 then + then ; + : >name 2 cells + dup begin 1+ dup c@ bl <= until over - ; : 'name latest begin 2dup >xt <> over 0<> and while @ dup 0= if 2drop 0 0 exit then repeat -- cgit v1.2.3