From dc84d26e2d6ffa1fb51e4d677876349a328a0afc Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Wed, 20 May 2026 04:24:27 -0700 Subject: create works now, and docol outputs successfully having some trouble with colon Force-Push: yes Change-Id: I5fc0f4519bdd8de1033e24730f63296d8076782e --- evoke.e | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'evoke.e') 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 -- cgit 1.4.1