From eec336dea3d86e176c4bd86c435e6be35fec64e2 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Mon, 18 May 2026 16:36:08 -0700 Subject: okay there's a strat for making the here/latest variables now it doesn't work yet, but it's gonna the reason it doesn't work is that the new helper log-load-variable relies on the assembly-definition words being statically available, and they aren't yet that's fine though, this is still a huge change, worth checking in. why? well, it represents like 16 hours of debugging which culminated in some very minor changes to the semantics of the label transform, in order to make missing words easier to notice and debug. see comments for details. woooooo :D Force-Push: yes Change-Id: Id8334819d165ba9e3156ef2bf32008af748eac29 --- log-load.e | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'log-load.e') diff --git a/log-load.e b/log-load.e index 1339d7b..71324f2 100644 --- a/log-load.e +++ b/log-load.e @@ -151,10 +151,19 @@ ~ TODO: remove one of them. Probably the other one. : log-offset 0x10000 ; ~ 64 KiB +~ (log address -- log address, "log" pointer) +: log-load-log + dup log-offset + ; +~ (log address -- log address, "s0" pointer) +: log-load-s0 + dup log-offset + 8 + ; +~ (log address -- log address, "r0" pointer) +: log-load-r0 + dup log-offset + 2 8 * + ; ~ (log address -- log address, "latest" pointer) : log-load-latest dup log-offset + 3 8 * + ; -~ (log address -- log address, "latest" pointer) +~ (log address -- log address, "here" pointer) : log-load-here dup log-offset + 4 8 * + ; @@ -236,3 +245,31 @@ ~ (log address, updated here value, here) ! ; + +~ This is the same as "variable", from interpret.e, except that it takes the +~ log's address as a parameter rather than hardcoding it, so that it can be +~ used in situations where the normal compilation process isn't yet available. +~ +~ (log address, address for new variable word, string pointer -- log address) +: log-load-variable + 3roll swap log-load-create + ~ (address for new variable word, log address) + + log-load-here 3unroll + ~ (log address, address for new variable word, here) + + dup @ + ~ (log address, address for new variable word, here, output point) + dup 8 + pack64 + + 3roll + :rax + mov-reg64-imm64 + ~ (log address, here, output point) + +~ :rax push-reg64 + pack-next + 8 packalign + + swap ! ; + -- cgit 1.4.1