diff options
Diffstat (limited to 'core.fth')
-rw-r--r-- | core.fth | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -65,18 +65,20 @@ dup cell+ allot rot here swap ! swap postpone literal postpone literal then ; immediate -: ." postpone s" state @ if postpone type else type then ; immediate +: type ?dup if 0 do dup c@ emit 1+ loop then drop ; +: ." 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 ; +: 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 ; + |