diff options
Diffstat (limited to 'core.fth')
-rw-r--r-- | core.fth | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -4,10 +4,6 @@ : then here swap ! ; immediate : else ['] _jmp , here 0 , swap here swap ! ; immediate -: 2r> ['] r> , ['] r> , ['] swap , ; immediate -: 2>r ['] swap , ['] >r , ['] >r , ; immediate -: r@ ['] r> , ['] dup , ['] >r , ; immediate - : _msb [ 1 cell 8 * 1- lshift ] literal ; : 2/ dup 1 rshift swap 0< if _msb or then ; @@ -69,7 +65,18 @@ dup cell+ allot rot here swap ! swap postpone literal postpone literal then ; immediate +: ." postpone s" state @ if postpone type else type then ; immediate : ( begin [char] ) key = until ; immediate : execute [ here 3 cells + ] literal ! [ ' _jmp , 0 , ] ; + +: move dup 0 <= if drop 2drop exit then + >r 2dup < r> swap if + 1- 0 swap do over i + c@ over i + c! -1 +loop + else + 0 do over i + c@ over i + c! loop + then 2drop ; +: fill -rot begin dup 0 > while + >r 2dup c! char+ r> 1- repeat + 2drop drop ; |