summary refs log tree commit diff
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-05-16 00:56:52 -0700
committerIrene Knapp <ireneista@irenes.space>2026-05-16 00:56:52 -0700
commitb564cab848ca4de050304cc8b53196a3420018a6 (patch)
tree6e985c9709f4d38f5771057ad5f0b3fdaea0d9a1
parent9922f43d213bb2f710f90cb5165a7580ef0326cd (diff)
it WORKS. WOW. nice.
more specifically, a generated hello-world that uses cold- and warm-start, and both assembly and Forth words, correctly calls the kernel's exit() with a parameter provided by a literal.

Force-Push: yes
Change-Id: I9a08f9cdad6bd0037a41655eecff6debea5f9ac3
-rw-r--r--transform.e11
1 files changed, 7 insertions, 4 deletions
diff --git a/transform.e b/transform.e
index e913d42..e788836 100644
--- a/transform.e
+++ b/transform.e
@@ -224,9 +224,9 @@ allocate-transform-state s" transform-state" variable
 : L;
   ~ This looks up "exit" by label.
   swap-transform-variables
-  L@' exit L@' origin
+  L@' exit
   swap-transform-variables
-  + ,
+  transform-offset ,
 
   latest @ unhide-entry
 
@@ -242,7 +242,10 @@ allocate-transform-state s" transform-state" variable
 ~ before attempting to understand "L;asm".
 : L;asm
   here @ pack-next 8 packalign here !
-  latest @ dup unhide-entry entry-to-execution-token dup 8 + swap !
+  latest @ dup unhide-entry entry-to-execution-token
+  ~ The codeword needs to be transformed to the target address space.
+  dup 8 + transform-offset
+  swap !
 
   ~   Since [ is an immediate word, we have to go to extra trouble to compile
   ~ it as part of ;asm.
@@ -344,7 +347,7 @@ allocate-transform-state s" transform-state" variable
         ~
         ~   Fortunately we don't have to look at it, just append it to the heap
         ~ and clean up.
-        drop , dropstring 0 exit
+        transform-offset , drop dropstring 0 exit
       } if
     } if
   } if