summary refs log tree commit diff
path: root/evoke.e
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-05-16 00:43:24 -0700
committerIrene Knapp <ireneista@irenes.space>2026-05-16 00:43:24 -0700
commit9922f43d213bb2f710f90cb5165a7580ef0326cd (patch)
tree8efe744025fb1673fa506293f385e96f12d7fb8d /evoke.e
parent09ae826c2f99b7e21606e01f577b934c1d669bdc (diff)
it's much closer, most of the labels work correctly now
Force-Push: yes
Change-Id: I45662e60c0035758a2cd57d971031eb0562eccb7
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