summary refs log tree commit diff
path: root/log-load.e
diff options
context:
space:
mode:
Diffstat (limited to 'log-load.e')
-rw-r--r--log-load.e39
1 files changed, 38 insertions, 1 deletions
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 ! ;
+