summaryrefslogtreecommitdiff
path: root/jefs.fs
diff options
context:
space:
mode:
Diffstat (limited to 'jefs.fs')
-rw-r--r--jefs.fs21
1 files changed, 20 insertions, 1 deletions
diff --git a/jefs.fs b/jefs.fs
index b726db0..9b073f7 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -16,10 +16,14 @@ decimal
: [compile] parse find drop >cfa compile, ; immediate
: ' parse find drop >cfa [compile] lit ; immediate \ note: no error handling (yet)
+: recurse latest @ >cfa compile, ; immediate
: literal [compile] lit ; immediate
: constant create [compile] lit ret, ;
: variable 1 cells allot create [compile] lit ret, ;
+32 constant bl
+: space bl emit ;
+
\ TODO interpret mode strings?
: s" [ char " ] literal 1 >in +! ( skip spc ) [compile] litstring ; immediate
: ." [compile] s" ' say compile, ; immediate \ lol this word breaks the highlighting, here have another "
@@ -34,8 +38,23 @@ decimal
: / /mod swap drop ;
: mod /mod drop ;
+\ PNO
+\ mostly from pforth
+\ currently broken if unsigned number has more than 18 digits
+\ unfortunately this also seems to include any negative number
+variable hld
+: <# dap hld ! ;
+: hold 1 hld -! ( chr ) hld @ c! ;
+: sign 0< if [ char - ] literal hold then ;
+: # base @ /mod swap 9 over > if 7 + then [ char 0 ] literal + hold ;
+: #s begin # dup 0= until ;
+: #> drop hld @ dap over - ;
+
+: ud. <# #s #> say space ;
+
: t ." testtest" cr ;
: testing 0 if TESTSTR else TESTSTR2 then say cr ;
-t
+1000000000000000000 999999999999999999 .s
+drop ud.
testing bye