Skip to content

Software

Vlad Todosin edited this page Aug 30, 2021 · 2 revisions

Overview

MinZ80 is programmed entirely in Z80 assembly. More information about the available instructions can be found by following the links provided in the bottom of this page. Due to the nature of the system, the programming is extremely "low-level", meaning that hardware devices must be addressed manually from software and therefore any software written for the system is hardware dependent.

All hardware "addresses" and all the words needed for communicating with the PIO, sound chip, LCD can be found in the constants.s file. The PIO chip acts as a "buffer" between the CPU and the sound chip and LCD, meaning that all I/O write instructions are directly sent to the PIO which then controls the rest of the chips. Although a bit more difficult software wise, this method was chosen because it didn't require any additional logic chips and was also able to maintain a relatively good speed (for a vintage singe-board computer running at 1MHz maximum, that is).

Initialization

When the system first powers up or it's restarted, the CPU will start executing instructions from ROM (address 0x00, to be specific; see hardware for a more detailed memory map). Before being able to use subroutines, it is necessary to initialize the stack pointer. This is done by writing a specific value to the SP register of the CPU.