Skip to content

An Intel 8080 emulator implemented entirely in C macros, capable of running Altair BASIC. 😨

Notifications You must be signed in to change notification settings

Xyene/macro8080

Repository files navigation

macro8080

This repository houses an implementation of an Intel 8080 microprocessor in C, which can run Altair BASIC and several CP/M test ROMs.

It's main target is a Nios II processor (specifically, an Altera DE1-SoC), though it contains shims for full functionality in Unix environments. A barebones PS/2 keyboard driver is implemented for input when running on the DE1-SoC.

This project was mostly intended as an experiment to see whether the core of an emulator could be implemented entirely using macros, as opposed to modularized code segments. Intuitively, this would provide greater performance at the cost of code size, which empirically appears to be valid.

Compilation

To build for a DE1-SoC, just import basic.amp.

To compile and run on a Unix machine:

$ git clone https://github.com/Xyene/macro8080.git
$ cd macro8080
$ make
$ ./i8080

By default, 8K Altair BASIC will load. Several macro definitions control further behaviour if macro8080 is built with them:

  • CPM will load a CPM test ROM and build CP/M BIOS functions
  • OVERRIDE_INPUT will automatically feed the source code of Civil War into BASIC (useful for demoing on a DE1-SoC)

How does it work?

A short write-up about the methods used to implement the Intel 8080 core entirely in macros can be found on my blog.

About

An Intel 8080 emulator implemented entirely in C macros, capable of running Altair BASIC. 😨

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published