

(, section "There are two stages of collapse") Not too quite so, and the COS author addresses this in its website.

I can't remember if the SIO/2 needs external address decoding logic, maybe you could cope without it if you are happy for it to use up every address?īut building an RC2014 would be easier and more likely to result in a working machine, and would give you almost all the knowledge required to build a scavenged one later if you still want to. FTDI) and communicate with your Z80 using a modern PC. Then you can connect the SIO to a USB serial cable (e.g. Then you need to load your code into the ROM at address 0. I think that should be all that is required. To build a scavenged machine, you'll need a Z80 CPU, a clock source (I think an RC oscillator would be the simplest working setup?), probably some sort of ROM, an SRAM, some sort of IO device (probably a Z80 SIO/2 for serial), and a 5V power supply. Once you've done that and you're trying to write code, this page is a good reference for the instructions: It gets a bit dry when it gets to the bit that documents the individual instructions, but the overview before that point is well worth reading. That falls into an unacceptable trade-off really easily in our current world, where the majority of developers are relatively inexperienced consumers of innumerable dependencies.ĭefinitely read (at least the first chapters of) the Z80 cpu manual: But you have to write it in that direction, and design the system that makes sense for the task from the very beginning. That's what breaks Forth away from being a simple macro-assembler. That makes it easy to implement, while not explicitly addressing expressability.įorth written "flat" with shallow data stack usage is assembly by another name, a wrapper for load-and-store Forth that does everything with intricate stack manipulation is a source of endless puzzles since it quickly goes write-only.īut, like any good language with meta expression capabilities, you can work your way up towards complex constructs in Forth, and write words that enforce whatever conceptual boundaries are needed and thus check your work and use the system as a compiler. Forth doubles down on this sequence-first approach through a more versatile assignment mode(the stack) while only minimally accommodating the other two. Assembly code on hardware architectures will assign all meaning sequence-relative, late-binding the selection and iteration. If I had to put my finger on why Forth is hard for most programmers, it's like this: the structured program theorem suggests using sequence, selection, and iteration to control program logic.
