commit 6123c6262e1e9f16a1ca42e4b81fc2420ce6c20b
parent f903c057c9c6fc6b5d21281b82043aa9e04b08be
Author: Christian Ermann <christian.ermann@joescan.com>
Date: Fri, 11 Jul 2025 19:36:23 -0700
Fix bug in 'bootstrap'...?
Diffstat:
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/forth.s b/src/forth.s
@@ -965,7 +965,7 @@ _read_line_nl:
li w, -1
next
-defword "tib-source!" tib_source_store, 0x93EE3A0D
+defword "tib-source!", tib_source_store, 0x93EE3A0D
# ( len -- )
jal tib
jal fetch_second
@@ -981,20 +981,25 @@ _bootstrap_loop:
jal tib
jal two_fetch
jal read_line
- jal q_branch
- .int _bootstrap_done
+ beqz w, _bootstrap_done
+_bootstrap_line:
+ jal drop
+ # store length
jal dup
addi w, w, -1
jal tib_source_store
+ # print line (for debugging)
+ #jal two_dup
+ #jal type
+ # increment source addr
jal plus
+ # interpret
jal to_ret
jal interpret
jal from_ret
j _bootstrap_loop
_bootstrap_done:
- jal tib_source_store
- jal drop
- jal interpret
+ jal two_drop
exit
defcode "abort", abort, 0xA52BCAF9