commit 8633d3f5761143f524d4498a3569ad4b15ff391f
parent 5609af2e7bbe0ad0344c771d2c32009748349a4c
Author: Christian Ermann <christian.ermann@joescan.com>
Date: Wed, 2 Jul 2025 19:22:38 -0700
Fix printing of context for 'error-unknown'
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/forth.s b/src/forth.s
@@ -500,6 +500,14 @@ defword "parse-string", parse_string, 0x1740A6F6
# ( -- addr len )
push_imm 0x22
jal parse_until
+ # copy string from 'source' before modifying
+ jal tuck
+ la x, _str_addr
+ push x
+ jal char_move
+ # translate escape sequences in-place
+ la x, _str_addr
+ push x
jal translate_escape
exit
@@ -1699,6 +1707,12 @@ _tib_addr:
.space 255
_tib_len = (. - _tib_addr)
+# this is used as a temporary location for strings inbetween parsing and
+# compilation.
+_str_addr:
+ .space 255
+ _str_len = (. - _str_addr)
+
.section ".text.boot"
.globl start
.balign cell