diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2025-01-02 21:17:54 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2025-01-02 21:17:54 -0500 |
commit | 8a6503cd7fa89424f0deac1a20e6cd1aa4899cd7 (patch) | |
tree | 6101f175995b3514399217307866170c2119981d /core.fth | |
parent | d27214a4dd00cf6489079037829447fe84adaaa7 (diff) |
move more words to forth
Diffstat (limited to 'core.fth')
-rw-r--r-- | core.fth | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |