This web site exists to document my adventures in writing software emulators for old computer hardware. So far, I have completed (sort of) a Commodore PET emulation and am working on a Sinclair Spectrum emulation.
In which I prematurely exit loops The basic DO loop is done. Now we need to implement LEAVE. This is effectively a “go to the end of the loop”. It seems simple enough but there is a problem in that LEAVE can occur – in fact, almost certainly will occur – inside other control structures, … Continue reading Go Forth and Leave
In which I create a real return stack So far, the return stack has been a hybrid of the Swift stack for returning from code and a stack implemented within the code for temporary values and loop control. It’s time to implement the whole stack in the code. I’m not sure if this will be … Continue reading Stacking Forth Returns
In which I go loopy trying to implement do loops Do loops are control structures that require a bit more thought than the ones implemented s far. The main problem is the existence of a loop variable, or, in the case of nested do loops, multiple loop variables. We’ll deal with that in a minute. … Continue reading I Do Forth
In which I continue my war against associated values In my previous post, I ended by trying to eliminate the CompiledWord cases that use associated values. These are: I’ve got rid of the last of these, but it was a difficult struggle. I did it by introducing a new word .jsr similar to .pushNext. So, … Continue reading My Fifth Rethink on Execution Tokens