From 1da54a4e8c55400181194a2db2cce4b96e479d61 Mon Sep 17 00:00:00 2001 From: Jonas Hvid Date: Thu, 14 Nov 2019 18:28:11 +0100 Subject: [PATCH] Add notes on how literals are handled --- notes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/notes b/notes index 378a31d..6906550 100644 --- a/notes +++ b/notes @@ -90,3 +90,10 @@ Here, DOCOL (the codeword) is address of the simple interpreter described above, while EXIT a word (implemented in assembly) that takes care of popping ESI and continuing execution. Note that DOCOL, DUP, + and EXIT are all stored as addresses which point to codewords. + +## Literals + +Literals are handled in a special way. There is a word in Forth, called LIT, +implemented in assembly. When executed, this word looks at the next Forth +instruction (i.e. the value of ESI), and places that on the stack as a literal, +and then manipulates ESI to skip over the literal value. -- 2.39.2