On 16/04/16 17:48, Programmingkid wrote:
I wanted to share what I found out. If I remove the '\r' to '\n' patch that allows Mac OS 9 to boot, the boot script will stop executing at a r> word. This is the position:
<BOOT-SCRIPT> here >r dev / cr ." Checkpoint 1" cr " model" active-package get-package-property abort" can't find MODEL" decode-string 2swap 2drop " iMac,1" $= ?dup 0= if " compatible" active-package get-package-property abort" can't find COMPATIBLE" false >r ." checkpoint 1.5" cr begin dup while decode-string here over 2swap bounds ?do i c@ dup [char] A [char] Z between if h# 20 xor then c, loop 2dup " macrisc" $= r> or >r 2drop repeat ." checkpoint 1.7" cr 2drop r> ." checkpoint 1.7.1" cr then ." checkpoint 1.7.2" cr
r> <--------------- This is where execution stops
Right, this is exactly the same issue. The Forth interpreter executes the boot script in interpret mode so as soon as it hits a command to alter the r-stack in boot script (which is not supposed to happen outside of a Forth word) then the interpreter itself gets confused and execution stops.
It just so happens that if you feed the chunks into the Forth interpreter in chunks between newlines then it works, but this is really just a lucky coincidence that things work out in this way.
ATB,
Mark.