summary refs log tree commit diff
path: root/evoke.e
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-05-20 04:24:27 -0700
committerIrene Knapp <ireneista@irenes.space>2026-05-20 04:24:27 -0700
commitdc84d26e2d6ffa1fb51e4d677876349a328a0afc (patch)
treeeb1c031b7aefa820259f3ad83e45ce23b44396c7 /evoke.e
parent25bb4c7651323b6879064cfdfb74d1771f56abca (diff)
create works now, and docol outputs successfully HEAD main
having some trouble with colon

Force-Push: yes
Change-Id: I5fc0f4519bdd8de1033e24730f63296d8076782e
Diffstat (limited to 'evoke.e')
-rw-r--r--evoke.e39
1 files changed, 29 insertions, 10 deletions
diff --git a/evoke.e b/evoke.e
index df59a2a..4252e91 100644
--- a/evoke.e
+++ b/evoke.e
@@ -10,6 +10,8 @@ s" source-to-precompile" variable
 
 ~ : fooze 4 . ; fooze
 1024 read-to-buffer
+~   We begin by outputting the actual docol routine, the one that codewords
+~ should point to. Note that this is before we've done any word header.
 here @
 dup L!' docol-codeword-value
 :rsi pack-pushcontrol
@@ -19,20 +21,37 @@ pack-next
 8 packalign
 here !
 
-: docol
-  [ here @
-    L@' docol-codeword-value :rax mov-reg64-imm64
-    :rax push-reg64
-    here ! ] ;asm
+~   We can't use colon to create docol, not even the part that's a word,
+~ because colon tries to dynamically invoke docol to fill in the codeword.
+s" docol" create
+here @
+dup 8 + pack64
+L@' docol-codeword-value :rax mov-reg64-imm64
+:rax push-reg64
+pack-next
+8 packalign
+here !
+
 
-: exit
-  [ here @
-    :rsi pack-popcontrol
-    here ! ] ;asm
+s" exit" create
+here @
+dup 8 + pack64
+:rsi pack-popcontrol
+here !
+
+: foo [ crash 1 2 + ;
 
-: foo 1 2 + ;
 0 sys-exit
+
+~   Now that we have docol, colon will work and we can define exit the normal
+~ way.
+~ : exit
+~   [ here @
+~     :rsi pack-popcontrol
+~     here ! ] ;asm
+
 pyrzqxgl
+~ 0 sys-exit
 s" source-to-copy-to-log" variable
 
 ~ (output memory start, current output point