summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jefs.fs3
1 files changed, 3 insertions, 0 deletions
diff --git a/jefs.fs b/jefs.fs
index 8dd4a8e..b36d9e3 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -1,6 +1,7 @@
\ i think something is going on with the stack. i dunno
: cell+ 8 + ;
+: cell- 8 - ;
: say ( c-addr u -- ) swap 1 1 syscall3 drop ;
: emit ( chr -- ) sp cell+ 1 swap 1 1 syscall3 2drop ;
: cr 10 emit ;
@@ -266,6 +267,8 @@ make error-msgs #error-msgs cells allot
: (words) ( lfa -- ) dup hidden? not if >nfa dup w@ swap 2 + swap say 2 spaces else drop then ;
: words latest @ begin ?dup 0<> while dup (words) @ repeat cr ;
+: depth ( -- n ) s0 @ sp @ - 16 - ;
+
\ I/O {{{
0 constant stdin
1 constant stdout