diff options
| author | kitty <nepeta@canaglie.net> | 2026-03-17 22:11:35 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-03-17 22:11:35 +1100 |
| commit | 45a7c61e63efef5edae68012b33bccca311ed62b (patch) | |
| tree | 542e0c52ed2fa6b0ba2dfceb9db8be07da127e46 | |
| parent | b8696a0bcbfcf3a0fee6ffd411b9e1c2dfc75e82 (diff) | |
[ and ]
| -rw-r--r-- | readme.md | 6 | ||||
| -rw-r--r-- | sanctuary.s | 8 |
2 files changed, 14 insertions, 0 deletions
@@ -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 |
