From dab770163829302cb6c68c1a173ec72d7cc1a31b Mon Sep 17 00:00:00 2001 From: kitty Date: Thu, 19 Feb 2026 12:26:42 +1100 Subject: recurse, bl, slightly broken PNO --- jefs.fs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'jefs.fs') 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 -- cgit v1.2.3