summaryrefslogtreecommitdiff
path: root/sanctuary.fs
diff options
context:
space:
mode:
Diffstat (limited to 'sanctuary.fs')
-rw-r--r--sanctuary.fs13
1 files changed, 13 insertions, 0 deletions
diff --git a/sanctuary.fs b/sanctuary.fs
index 2715912..c420890 100644
--- a/sanctuary.fs
+++ b/sanctuary.fs
@@ -61,6 +61,12 @@
branch >mark >r 2dup cmove, nip ( u ) ( R: mark )
r> dup >resolve 4 + ( u a )
postpone literal ( a ) postpone literal ( u ) ; immediate compile-only
+: z" [ char " ] literal parse ( a u )
+ branch >mark >r 2dup cmove, 0 c, nip ( u ) ( R: mark )
+ r> dup >resolve 4 + ( u a )
+ postpone literal ( a ) drop ; immediate compile-only
+: zstrlen dup begin dup c@ 0<> while 1+ repeat swap - ;
+: s>z here -rot cmove, 0 c, ;
1 constant stdout
2 constant stderr
@@ -68,4 +74,11 @@
: type swap stdout 1 syscall3 ;
: emit sp 1 swap stdout 1 syscall3 2drop ;
+hex
+\ really i should just change the builtins to work with defer
+: hijacks ' ( word ) here >r dp ! ( temporarily set dp so we can use , )
+ 49 c, bb c, ( xt ) , \ mov r11, xt
+ 41 c, ff c, e3 c, \ jmp r11
+ r> dp ! ;
+decimal
bye