summaryrefslogtreecommitdiff
path: root/jefs.fs
diff options
context:
space:
mode:
Diffstat (limited to 'jefs.fs')
-rw-r--r--jefs.fs14
1 files changed, 10 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 + ;