A very interesting feature of the Z80 microprocessor is that it has separate memory and I/O space. Separated memory and I/O space means that instead of having to treat your peripherals as a memory address in between your other actual memory devices you can instead address them in a different way. This may not seem like a big deal, but it is very convenient.
The Z80 microprocessor supports three interrupts modes; 0, 1, and 2. In interrupt mode 0 the Z80 gets an instruction from the data bus given by the peripheral and executes it. This instruction is normally RST0 -> RST7 which resets the Z80 to a specific location given by that instruction. In interrupt mode 1 the Z80 jumps to address 0038h where it runs a routine that the programmer implements. In interrupt mode 2 the Z80 gets a byte from the data bus and jumps to the 16-bit address formed by combining the ‘I’ (interrupt vector) register and the supplied byte from the peripheral.
It is very annoying to have to use two platforms to do all of my work. Of course you can use a virtual-machine to run a system within a system, specifically Linux running within a virtual-machine on a Windows system, but this is very cumbersome. So I set out to find a Z80 assembler for Windows, and this is what I found.
This first step in assembling Z80 assembly code is to get an assembler. You can search all day for an assembler and find a lot of different flavors for Windows, Linux, and MACOSX. I personally do not care what platform it comes on as long as it works. The one I am using is on a Linux system. After hours of finding, testing, and failing I have found an assembler that works.
Memory is the fuel of a system. The memory is where instructions and data are stored. There are many types of memory, but for simplicity we will specifically be considering parallel ROM and RAM devices.
The Z80 Microprocessor is an 8-bit microprocessor that comes in many package types and has 40 usable pins. These pins make up the power, address bus, data bus, control signals, and clock that run a system. There are 2 power pins, 8 data pins, 16 address pins, 13 control signal pins, and one clock pin. Since there are 16 address pins the Z80 can address a total of 64KB (2^16) of memory without special circuitry.
This journal will randomly document things I have learned about the Z80 Microprocessor as I either learn or are am interested in them. I hope to randomly aggregate material and present it as a boiled down version of the topic at hand, almost like a chapter summary without the bullet points. I will try to avoid datasheet style writing, and instead explain things as I see them, since datasheets rarely explicitly help solve problems in my designs, but rather supplement arriving at the solutions. I will most likely be wrong on many topics, and will try to correct myself if it is pointed out, or I realize the material is incorrect.