InPermutation / z80cpuEmulator

A highly portable Zilog Z80 cpu emulator running a fully operational BASIC-based system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Codacy Badge

Z80 CPU Emulator

Introduction

This is a highly portable Zilog Z80 cpu emulator written in C programming language. The project was originally born in order to provide an in-software version of the remarkable Grant's 7-chip Z80 computer (link). Although the emulator runs a slightly modified version of the Microsoft BASIC as used in the Nascom 2 computer, the Z80 core can be used as a starting point for any other ambitious project.

Emulated system hardware

The baseline emulated hardware architecture has the following specification:

  • Z80 CPU core
  • 32KB ROM to store programs
  • 32KB RAM to store runtime data
  • MC6850 ACIA as serial communication interface

Building

To compile and run the emulator, your system must have the ncurses library installed. To do that, run the following command:

$ sudo apt-get install libncurses5-dev libncursesw5-dev

After having cloned the git repository, proceed with the commands below.

$ cd z80cpuEmulator     # Enters the project's directory
$ make                  # Builds the emulator
$ ./z80emulator         # Runs the executable

In order to clean your system from compiled source files, logs and executables, execute make clean.

System start up

As soon as the emulator is started, messages start popping up on the terminal. At Memory top? press ENTER to use full memory (32KB), otherwise enter the required value. After testing memory, the following text appears:

Z80 BASIC Ver 4.7b
Copyright (C) 1978 by Microsoft
32382 Bytes free
Ok

The BASIC interpreter is now ready to use and accept commands. To exit the emulator, press CTRL+C.

Limitations

Currently, the project has the following known issues and limitations:

  • DAA instruction not implemented
  • IN/OUT group partially implemented
  • Support for mode 1 interrupts only

Credits

Please, keep in mind that the modified BASIC interpreter is a Grant Searle's intellectual property. In this repository you will find the .HEX file loaded up by the emulator. If you need further information and would like to delve into the hardware implementation, have a look at http://searle.hostei.com/grant/z80/SimpleZ80.html.

About

A highly portable Zilog Z80 cpu emulator running a fully operational BASIC-based system.

License:GNU General Public License v3.0


Languages

Language:C 99.5%Language:Makefile 0.5%