Close

Corrected initialisation sequence

A project log for Bootstrapping a ROMless Z80 using RS-232

Is it possible to bootstrap a simple ROMless Z80 system using only two wires - e.g. from an RS232 interface? This project explores this.

willstevenswill.stevens 01/13/2024 at 07:010 Comments

The previous log entry incorrectly stated that SP is initialised to 0000 on reset. This isn’t true - it is undefined - so it needs to be initialised too. Here is a sequence that will do this:

E1 11100001 POP HL
F1 11110001 POP AF
31 00110001 LD SP,nn
31 00110001 
E3 11100110 
F6 11110110 OR n
76 01110110 
76 01110110 HALT

Because LD SP,nn is executed after POP HL and POP AF, this code needs to be executed twice, which can be achieved by pressing reset a short time after power on. You can see above that the data bits are still a fairly simple function of the address bits. A 6PDT switch will be needed to switch between this sequence and the “memory program” sequence described in the first log entry.

So the complete sequence of steps required to bootstrap the system will be:

Discussions