diff options
| author | kitty <nepeta@canaglie.net> | 2026-02-19 12:26:42 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-02-19 12:26:42 +1100 |
| commit | dab770163829302cb6c68c1a173ec72d7cc1a31b (patch) | |
| tree | 2e8b032cb0c8c52d8bda7fe334e8e15e96dacd07 /jefs.fs | |
| parent | 1c528d56a86e2a1a5b32e15963844e64bd50fab2 (diff) | |
recurse, bl, slightly broken PNO
Diffstat (limited to 'jefs.fs')
| -rw-r--r-- | jefs.fs | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -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 |
