Add list of built-in variables
authorJonas Hvid <mail@johv.dk>
Mon, 18 Nov 2019 17:47:55 +0000 (18:47 +0100)
committerJonas Hvid <mail@johv.dk>
Mon, 18 Nov 2019 17:47:55 +0000 (18:47 +0100)
notes.md

index 7788c33ff7e5228f3bc7e7d73dda2f531d886955..f82824cca8d56bf183689c237762aefc1be41c88 100644 (file)
--- a/notes.md
+++ b/notes.md
@@ -101,3 +101,11 @@ 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.
 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.
+
+## Built-in variables
+
+* **STATE** -- Is the interpreter executing code (0) or compiling a word (non-zero)?
+* **LATEST** -- Points to the latest (most recently defined) word in the dictionary.
+* **HERE** -- Points to the next free byte of memory.  When compiling, compiled words go here.
+* **S0** -- Stores the address of the top of the parameter stack.
+* **BASE** -- The current base for printing and reading numbers.