diff options
Diffstat (limited to 'core.fth')
-rw-r--r-- | core.fth | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -93,5 +93,22 @@ : min 2dup <= if drop else swap drop then ; : max 2dup <= if swap drop else drop then ; -5 spaces - +: source _source @ _sourceu @ ; +: count dup char+ swap c@ ; +: char 0 here char+ c! bl word char+ c@ ; +: [char] char postpone literal ; imm + +: ( begin [char] ) key <> while repeat ; imm + +: _type >r begin dup 0 > while + swap dup c@ r@ execute char+ swap 1- repeat 2drop r> drop ; +: type [ ' emit ] literal _type ; +: s" state @ if ['] _jmp compile, here 0 , then + [char] " word count + state @ 0= if exit then + dup cell+ allot + rot here swap ! + swap postpone literal postpone literal ; imm +: ." postpone s" state @ if ['] type compile, else type then ; imm + +." hello world" |