diff options
| author | kitty <nepeta@canaglie.net> | 2026-02-28 17:57:35 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-02-28 17:57:35 +1100 |
| commit | 4f9d8ac79867481d8682246937fc4df7ac6c75a4 (patch) | |
| tree | c9af0d40aea3b337217e74d74cd179b2662bb2ce | |
| parent | 412c6cc2a7df083d481ce2737547060677761d22 (diff) | |
octal, :noname
| -rw-r--r-- | jefs.fs | 15 | ||||
| -rw-r--r-- | jefs.s | 5 |
2 files changed, 12 insertions, 8 deletions
@@ -14,6 +14,7 @@ : emit ( chr -- ) sp cell+ 1 swap 1 1 syscall3 2drop ; : cr 10 emit ; +: octal 8 base ! ; : decimal 10 base ! ; : hex 16 base ! ; @@ -63,7 +64,6 @@ hex : ret, c3 c, ; decimal : ?comp state @ 0<> if 3 error ! handler execute then ; : ?intr state @ if 4 error ! handler execute then ; -\ todo flow ctl wrappers with ?comp : cells 8 * ; : allot> here @ swap here +! ; @@ -79,6 +79,14 @@ hex : ret, c3 c, ; decimal \ maybe i made bad design decisions, this is CREATE but it pushes a pointer to just after its definition. for arrays and the like \ does not use LIT because we want to fill it in After : make create here @ 18 + [compile] lit ret, ; +\ creates a word called _ (so don't create an actual word called that!!!) +\ maybe it could be an empty string but that might require some rewriting +\ (maybe a bad solution, but ; expects a header and reads from LATEST... +\ maybe WORDS should skip words whose name is just _?) +\ it may not be a bad idea to redefine ; above this so it works with :noname words. +\ maybe a NONAMING? variable so we know it's a noname word and thus does not need to be unsmudged? +\ also we can't use CREATE because it reads from tib. eugh +: :noname here @ latest @ , 0 c, 1 w, [ char _ ] literal c, latest ! smudge here @ ( ← xt ) [compile] ] ; \ jonesforth impl : case 0 ; immediate @@ -266,6 +274,7 @@ make file-buffer file-buffer-length allot \ INTERACTIVITY {{{ \ }}} -file-buffer file-buffer-length stdin read-file drop file-buffer swap evaluate +.free +\ file-buffer file-buffer-length stdin read-file drop file-buffer swap evaluate +:noname 1 2 3 .s ; bye -\ .free bye @@ -518,11 +518,6 @@ defword ";", semicolon, immediate_mask mov qword [state], interpreting ret -; this is basically an edited copy of : -; which should probably be rewritten to use this word -; the differences: -; this word does not change state -; smudge mask is not set defword "create", create, 0 call parse pspop r9 ; u |
