Arduino 8-bit Computer

An emulated 8-bit computer based on an Arduino.

Similar projects worth following
The main goal of this project is to learn about 8-bit computers and assembly code. I plan to emulate a custom 8-bit CPU and peripherals with an Arduino micro-controller. I will be using Z80 op-codes so that I can use an existing assembler. I would also like to find an easy method to transfer a Z80 binary file into the Arduino, but for now I'm just embedding the binary code into an array in the Arduino sketch. Ultimately, I would like this to be able to run any simple Z80 code. I'm currently running this on an Arduino Uno, but I will likely end up using an Arduino Mega board.

Many op-codes have not been included yet, however there are enough to write some simple programs.

I will try to have an example for every op-code.


Load: Put a 3 in register A

Mnemonic:      Op-code:

LD A,3             0x3E, 0x03

Add: Add 2 to 5

Mnemonic:    Op-code:

LD  A,5           0x3E, 0x05

LD  B,2           0x06, 0x02

ADD  A,B       0x80

Subtract: Subtract 3 from 5

Mnemonic:   Op-code:

LD  A,5          0x3E, 0x05

LD  B,3          0x06, 0x03

SUB B            0x90 

  • 1 × Arduino Uno

  • Memory successes and problems.

    Ryan Gass06/26/2014 at 18:05 0 comments

    The emulator  now lets code access the SD card using I/O instructions. One of these instructions tells the Arduino to load a binary file into the emulated memory. This is nice, however the memory array is stored in RAM, so it is very limited in size. I will likely switch to using flash instead.

  • It works!

    Ryan Gass05/26/2014 at 19:53 0 comments

    I was able to blink the LED on pin 13 using my emulator and Z80 compatible op-codes.

View all 2 project logs

Enjoy this project?



Marcelo Dantas wrote 12/29/2014 at 16:58 point

Hi Ryan, have you tried SPI RAM? I have written a similar emulation for the Arduino DUE (no memory shortage there), but I am planning to migrate it to the Teensy 3.1, using external SPI RAM. Theoretically it could be done by the UNO as well.

  Are you sure? yes | no

Ryan Gass wrote 01/03/2015 at 03:50 point

It should be able to use anything that you could map to an array. I haven't worked on this for a while, but I've been thinking about using the EEPROM for ROM so you could just burn a HEX or BIN file into the EEPROM.

  Are you sure? yes | no

bijtaj wrote 06/26/2014 at 19:05 point
How are you programming it? using your computer? Will you have an LCD screen?

  Are you sure? yes | no

Ryan Gass wrote 06/26/2014 at 21:09 point
I am using zDevStudio on my computer to generate a bin file that I put on the SD card. The Arduino loads the bin file off the SD and runs it. I have a LCD shield that I plan to add to it.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates