summaryrefslogtreecommitdiff
path: root/jefs.fs
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-02-24 14:59:23 +1100
committerkitty <nepeta@canaglie.net>2026-02-24 14:59:23 +1100
commitcb16fdb58dbe98c49831a596d332defc2740c051 (patch)
treeab66c3e63a3baf4ba7bf8cc91708542394988dfa /jefs.fs
parentd3306df06f02023a1fe16156cc0a7c656dcceff7 (diff)
WORDS
still not sure whats going on with s". i have discovered that using multiple s" seems to point the LFA of cell+ (the first forth-defined word) to directly after the text of the second string. now i just need to figure out Why or How that could possibly be happening.
Diffstat (limited to 'jefs.fs')
-rw-r--r--jefs.fs13
1 files changed, 9 insertions, 4 deletions
diff --git a/jefs.fs b/jefs.fs
index 02b52c9..9677229 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -45,7 +45,7 @@ hex : ret, c3 c, ; decimal
\ TODO interpret mode strings?
\ : s" [ char " ] literal 1 >in +! ( skip spc ) [compile] litstring ; immediate
-: s" 1 >in +! [ char " ] literal cparse branch >mark >r 2dup s, r> >resolve swap [compile] lit [compile] lit ; immediate
+: s" 1 >in +! [ char " ] literal cparse branch >mark >r 2dup cmove, r> >resolve swap [compile] lit [compile] lit ; immediate
: ." [compile] s" ' say compile, ; immediate \ lol this word breaks the highlighting, here have another "
\ https://wiki.osdev.org/X86-64_Instruction_Encoding
@@ -154,7 +154,7 @@ variable hld
: .qword (.qword) say space ;
: ? @ . ;
-: .s sp 8 + ( skip sp itself ) begin dup s0 @ >= while dup @ .qword 8 + repeat drop cr ;
+: .s sp 8 + ( skip sp itself ) begin dup s0 @ > while dup @ .qword 8 + repeat drop cr ;
: bytes-allocated hend @ h0 @ - ;
: bytes-used here @ h0 @ - ;
: bytes-free bytes-allocated bytes-used - ;
@@ -164,7 +164,12 @@ variable hld
\ it only seems to happen if the called word is a builtin or a number?????
\ : .free bytes-free u. ." of " bytes-allocated u. ." bytes free (used " bytes-used (.) say ." )" cr ; \ segfaults
+: >nfa ( lfa -- nfa ) 9 + ;
+: (words) ( lfa -- ) >nfa dup w@ swap 1+ 1+ swap say 2 spaces ; \ TODO works? maybe? idk
+: words latest @ begin ?dup 0<> while dup (words) @ ( todo ->NEXT ) repeat cr ;
+
\ .free bye
-: t s" eue eu eo o eu" drop .s say ;
+\ : t s" eue eu eo o eu" drop .s say s" eue " ;
-t bye
+words
+bye