From: Jonas Hvid Date: Thu, 14 Nov 2019 17:28:11 +0000 (+0100) Subject: Add notes on how literals are handled X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=1da54a4e8c55400181194a2db2cce4b96e479d61;p=rrq%2Fjonasforth.git Add notes on how literals are handled --- 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.