diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-02-09 18:20:35 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-02-09 18:20:35 -0500 |
commit | 501ca28d509bf6f41ed5797fa68f07e37ab9a294 (patch) | |
tree | 4c100967b4393b95c81e644da8280e83aacf47ee /core.fth | |
parent | 5bc9e4d2add7d2185b2c57a18ebd15b31f5366bd (diff) |
add more core.fth words
Diffstat (limited to 'core.fth')
-rw-r--r-- | core.fth | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -1,15 +1,48 @@ ( : variable create 0 , ; ) ( : create here const ; ) -: . 0 sys ; +( set decimal numbers ) +10 0 ! + +: . 0 sys ; +: emit 1 sys ; : over 1 pick ; : -rot rot rot ; : nip swap drop ; : tuck swap over ; +: +! swap over @ + swap ! ; + : 1+ 1 + ; : 1- 1 - ; : 0= 0 = ; : >= < 0= ; + +: 2drop drop drop ; +: 2dup over over ; +: 2over 3 pick 3 pick ; +: 2swap rot >r rot r> ; + +: and & ; +: or | ; +: xor ^ ; +: lshift << ; +: rshift >> ; + +: , here ! 1 allot ; +: c! ! ; +: c, , ; +: c@ @ ; +: cell+ 1+ ; +: cells ; +: char+ 1+ ; +: chars ; + +: cr 9 emit ; +: bl 32 ; + +: base 0 ; +: decimal 1 2* base ! 1010 base ! ; + |