forth-riscv

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

commit e169e2607abffaae961257dc38b81271e0d52a07
parent 63187ee6f2f465240f4c08c095ee834df6049baf
Author: Christian Ermann <christianermann@gmail.com>
Date:   Wed, 13 Nov 2024 17:30:38 -0800

Fix 'find' to skip hidden words

Diffstat:
Mforth.s | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/forth.s b/forth.s @@ -390,8 +390,10 @@ defword "find", find, 0xBDF0855A .int hash .int latest, fetch _find_loop: - .int dup, zero_equal, q_branch, _find_check_hash + .int dup, zero_equal, q_branch, _find_check_hidden .int swap, drop, exit +_find_check_hidden: + .int dup, hidden_q, zero_equal, q_branch, _find_next_word _find_check_hash: .int two_dup .int word_to_hash, equal, q_branch, _find_next_word @@ -889,6 +891,14 @@ defcode "hidden", hidden, 0xF618F139 sb x, 0(w) next +defcode "hidden?", hidden_q, 0x6F436C72 + pop w + addi w, w, flag_offset + lb x, 0(w) + andi x, x, flag_hidden + push x + next + defword ":", colon, 0x3F0CB86D .int create # create header .int lit, -cell, allot