forth-riscv

My forth
git clone git://git.electrosoup.com/forth-riscv
Log | Files | Refs

commit 13f75d2ef2aab619dd0592f85a80e88444d1e062
parent befdb1f165c3f13255de63d0ca7f3a9513ce6673
Author: Christian Ermann <christianermann@gmail.com>
Date:   Mon,  4 Nov 2024 19:14:13 -0800

Add '\' and '('

Diffstat:
Mforth.f | 8+++++++-
Mforth.s | 2+-
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/forth.f b/forth.f @@ -8,8 +8,14 @@ : begin here ; immediate : while postpone if swap ; immediate -: again postpone branch comma ; immediate +: again postpone branch , ; immediate : repeat postpone again postpone then ; immediate : test-if if type then exit ; +: literal postpone lit , ; immediate +: ')' [ parse-char ) ] literal ; + +: \ begin parse-char while repeat ; immediate +: ( begin parse-char dup while ')' = if exit then repeat ; immediate + diff --git a/forth.s b/forth.s @@ -720,7 +720,7 @@ _hash_char: mv w, t0 ret -defcode "[", 1, 0, 0xDE0C1FBA, l_bracket, hash +defcode "[", 1, flag_immediate, 0xDE0C1FBA, l_bracket, hash la w, _state li x, state_immediate store_cell x, 0(w)