summaryrefslogtreecommitdiff
path: root/jefs.fs
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-02-15 03:31:46 +1100
committerkitty <nepeta@canaglie.net>2026-02-15 03:31:46 +1100
commit02b0c608ac82322c6ef65ee96650f877bb7abd94 (patch)
tree62a59d8da8df5d3f21473591cbd017e87e78fe9a /jefs.fs
parentf7174a6c09335d1c03d927594f7e7630364dac6d (diff)
working if + then, i think?
Diffstat (limited to 'jefs.fs')
-rw-r--r--jefs.fs12
1 files changed, 7 insertions, 5 deletions
diff --git a/jefs.fs b/jefs.fs
index 309f118..eaf93c1 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -3,14 +3,16 @@
: begin here @ ; immediate
: again branch here @ 4 + - d, ; immediate \ add 4 to get to beginning of the next instruction
-\ : if 0branch here @ 0 d, ; immediate ( I: -- a )
-\ : then dup here @ 4 + swap - swap d! ; immediate
+: if 0branch here @ 0 d, ; immediate ( I: -- a )
+: then dup here @ swap - 4 - swap d! ; immediate
: / /mod swap drop ;
: mod /mod drop ;
: syswrite ( u c-addr fd -- n ) 1 syscall3 ;
: say ( c-addr u -- ) swap 1 syswrite drop ;
-\ : saying 0 if TESTSTR say then ;
-\ saying bye
-TESTSTR say bye
+: saying 0 if bye then ; \ err: failure will result in infinite loop?
+\ in specific it jumps back to the beginning of the word it seems. why?
+\ the correct jump val should be 0x1a
+saying TESTSTR say bye
+\ TESTSTR say bye