summary refs log tree commit diff
path: root/evoke.e
diff options
context:
space:
mode:
Diffstat (limited to 'evoke.e')
-rw-r--r--evoke.e38
1 files changed, 36 insertions, 2 deletions
diff --git a/evoke.e b/evoke.e
index 68645cb..86e79c8 100644
--- a/evoke.e
+++ b/evoke.e
@@ -2,9 +2,43 @@
 ~     | ./quine > evoke && chmod 755 evoke && ./evoke
 
 1024 read-to-buffer
-: foo ;asm
+~   Any word that ends with a normal semicolon will require this, so its
+~ definition has to be near the start.
+: exit
+  [ here @
+    :rsi pack-popcontrol
+    here ! ] ;asm
+
+: lit
+  [ here @
+    lods64
+    :rax push-reg64
+    here ! ] ;asm
+
+: sys-exit
+  [ here @
+    60 :rax mov-reg64-imm64
+    :rdi pop-reg64
+    syscall
+    hlt
+    here ! ] ;asm
+
+: happy-path 42 sys-exit ;
+
+~  : lods64 ;
+~  : :rax ;
+~  : push-reg64 ;
+~  : mov-reg64-imm64 ;
+~  : :rdi ;
+~  : pop-reg64 ;
+~  : syscall ;
+~  : hlt ;
+~  : here ;
+~  : @ ;
+~  : ! ;
+~  : [ ;
+~  : ] ;
 
-: bar ;asm
 pyrzqxgl
 s" source-to-precompile" variable