diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-05-20 19:59:18 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-05-20 20:03:01 -0700 |
| commit | 2fcfc1bcb59e0c1716a6a7dffcad4e0b90790a20 (patch) | |
| tree | 4ee37eaf51f26913170d062c14be29274b486618 /execution.e | |
| parent | 53f52a67b7c5bb8af12c92a2f3a219e75dd9b0c3 (diff) | |
so yeah, docol, exit, and lit all work in log-load now
also s" and ." work in the label transform, and are used to produce an important error message during the log-load routine, since we can't know whether log-loaded words exist until runtime sweet, right? Change-Id: I6a67139538c2cbcef40a1093202b2b4e0ad6febb Force-Push: yes
Diffstat (limited to 'execution.e')
| -rw-r--r-- | execution.e | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/execution.e b/execution.e index c3f99f2..2c8b869 100644 --- a/execution.e +++ b/execution.e @@ -176,7 +176,15 @@ ~ pointer where we asked; we don't need to check what those addresses are, ~ because they're not randomized. ~ -~ This routine is really only responsible for one-time initialization. +~ Notably, though cold-start points rbp to the control stack, it leaves +~ the control stack empty, so trying to return will pop a value that doesn't +~ exist, and crash. Eventually, the bottom value on the control stack will +~ be the word "quit", which loops forever and is the closest thing Forth has +~ to a "main" word, but it's up to warm-start to make that happen. +~ +~ Cold-start is really only responsible for one-time initialization. +~ +~ ~ ~ Registers in: ~ @@ -186,11 +194,9 @@ ~ ~ Registers out: ~ -~ * rsi points within "quit" -~ Quit is the word that's Forth's closest equivalent to main(). +~ * rsi points within "warm-start" ~ * rsp points to the top of the value stack -~ -~ Notably, rbp is still uninitialialized after _start. +~ * rbp points to the top of the control stack ~ ~ Stack in: ~ |