summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-02-27 22:44:36 +1100
committerkitty <nepeta@canaglie.net>2026-02-27 22:44:36 +1100
commit412c6cc2a7df083d481ce2737547060677761d22 (patch)
tree9a992418ca9a18cb54e0d92972781dbe587cd382
parent8681f4bd1cf3b11b1eca56f322192d816a199b8a (diff)
?comp ?intr (not used yet though)
-rw-r--r--jefs.fs14
-rw-r--r--readme.md2
2 files changed, 12 insertions, 4 deletions
diff --git a/jefs.fs b/jefs.fs
index 444cb38..d6ea585 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -61,6 +61,10 @@ hex : ret, c3 c, ; decimal
\ mod r/m reg /2 r/m 1.011 (r11)
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 +! ;
: allot allot> drop ;
@@ -199,14 +203,16 @@ variable hld
: bytes-free bytes-allocated bytes-used - ;
: .free bytes-free u. ." of " bytes-allocated u. ." bytes free (used " bytes-used (.) say ." )" cr ;
-\ FUCK is BYE but it takes an error code. its called that because you call it when shit is fucked.
-: fuck ( code -- ) 60 syscall1 ;
-: (handler) >s0 error @ dup case
+: #bye ( code -- ) 60 syscall1 ;
+: (handler) >s0 error @ dup case
1 of ." stack underflow" endof
2 of ." word not found" endof
+ 3 of ." compile mode only" endof
+ 4 of ." interpret mode only" endof
." unknown error"
- endcase cr fuck ;
+ endcase cr #bye ;
' (handler) to handler
+: fuck ( n -- ) error ! handler execute ;
: >ffa ( lfa -- ffa ) 8 + ;
: >nfa ( lfa -- nfa ) 9 + ;
diff --git a/readme.md b/readme.md
index 9a34d61..7fd313d 100644
--- a/readme.md
+++ b/readme.md
@@ -84,3 +84,5 @@ the error codes are:
- 0: nothing.
- 1: stack underflow
- 2: word not found
+- 3: compilation only
+- 4: interpret only