On 05/02/16 12:33, BALATON Zoltan wrote:
On Thu, 4 Feb 2016, Programmingkid wrote:
Here is another reason why I think the CR-LF patch should be applied:
[...]
With and without the patch Fedora makes it to the same place.
This does not change that it's a hack we should avoid, especially if it only works by chance.
On Thu, 4 Feb 2016, Mark Cave-Ayland wrote:
From memory the r-stack commands were being executed but the only reason this worked was because of the OpenBIOS trampoline between calling each word which just about allowed execution to continue.
Do you have any more info about what are these r-stack commands and what's the issue with them currently so we can find a way that this could be cleanly resolved? Maybe if you can describe what needs to be done someone would be able to pick it up and create a patch.
Well the r-stack is the Forth equivalent of a frame pointer, i.e. the return address once the end of the word is reached. In Forth world, the r-stack can be used for temporary storage as long as it is returned to its initial state before the currently executing word has completed.
The Apple 9.2 bootloader ignores the Forth specification in this respect and includes direct r-stack commands and hence the return address is corrupted once they have executed (for fun, try typing r-stack commands directly into the OpenBIOS command line).
So the solution is to find some way to preserve the r-stack in this context to ensure that execution continues back at the right location.
HTH,
Mark.