summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--readme.md6
-rw-r--r--sanctuary.s8
2 files changed, 14 insertions, 0 deletions
diff --git a/readme.md b/readme.md
index b53648c..6416c28 100644
--- a/readme.md
+++ b/readme.md
@@ -21,6 +21,12 @@ the following is a list of words available in this forth.
### `#tib ( -- a )`
variable containing the amount of characters in the input buffer.
+### `[ ( -- ) IMMEDIATE`
+set the system to interpret mode.
+
+### `] ( -- ) IMMEDIATE`
+set the system to compiling mode.
+
### `>body ( xt -- a )`
yield the code field of xt.
diff --git a/sanctuary.s b/sanctuary.s
index ce407c1..eda1466 100644
--- a/sanctuary.s
+++ b/sanctuary.s
@@ -397,6 +397,14 @@ defcode "compile,", compile_comma, 0
mov qword [here], r12
ret
+defcode "[", lbrac, immediate_mask
+ mov qword [state], INTERPRET
+ ret
+
+defcode "]", rbrac, immediate_mask
+ mov qword [state], COMPILING
+ ret
+
; number {{{
defcode "number", number, 0 ; ( c-addr u -- ?n flag )
pspop r11 ; u