Time was worth relatively little in comparison and I figured I will at least know the instruction set inside-out.
Time was worth relatively little in comparison and I figured I will at least know the instruction set inside-out.
Did you bootstrap it with hand-assembled code or some Basic? Did you assemble the assembler with itself?
https://www.amazon.nl/Assembly-Language-Programming-Lance-Le...
Memory management was a tricky part and macro expansion only got done after the whole thing worked (that would have saved a lot of time but I couldn't see the wood for the trees at that point).
The nasty part was that instructions were variable length so you could get into these weird errors where your initial guess for a jump target was too small, which would then move everything else as well, which might lead to other jumps becoming too small. I don't have the code any more but I think I fixed that by making all the jumps long jumps initially. A bit wasteful but that way I could at least get it to work in one pass. Later on when I got better at assembly that sort of thing got fixed.
The end product was endless 'data' statements that were poked into memory at 48K and up, right over the basic interpreter, which we had figured out a way to page out and replace from software. This later led to an annotated version of the basic that came with that computer (a version of MS Basic) and subsequently a replacement interpreter with a lot of built in goodies (double speed tape interface, a whole raft of new statements and functions). Good times!
Shout out to my friend Henri G. who did at least half of that work, we had identical home computers (Dragon 32) and worked together a lot on this. He probably still has his in working order :)
Ye that one is annoying.
I am making a VM compiler right now, and I have the same problem. I would probably have to make some intermediate tree to solve it without making every jump a "far jump".
Moving instructions is a headache :)
But Woz's trick is far more impressive.
(Had to Google to remember this bit of trivia again -- funnily enough turned up this [2] HN comment I replied to 9 years ago with nearly the exact same comment I made above.)
[1] https://support.apple.com/kb/TA39083?locale=en_US&viewlocale...