diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-10-24 10:26:42 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-10-24 10:26:42 -0400 |
commit | 6bd7c01389441b1e7f87f370beeb8212dae1656b (patch) | |
tree | da2f55fa63cde8513283722cd940c8977daaf01b /forth/core.fth | |
parent | 3d7a45e5cddc94d7bd5a3433a561f16fdb5e18a0 (diff) |
implement pictured numeric output
Diffstat (limited to 'forth/core.fth')
-rw-r--r-- | forth/core.fth | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/forth/core.fth b/forth/core.fth index f16224a..ec4bcb5 100644 --- a/forth/core.fth +++ b/forth/core.fth @@ -217,3 +217,14 @@ >r dup c@ swap >r base @ swap dup _isdigit - _uma r> char+ r> 1- repeat ; + +: <# 40 here c! ; +: #> 2drop here dup c@ + 40 here c@ - ; +: hold -1 here +! here dup c@ + c! ; +: # base @ + >r 0 i um/mod r> swap >r um/mod r> + rot 9 over < + if 7 + then 48 + hold ; +: #s begin # 2dup or 0= until ; +: sign 0< if [char] - hold then ; + |