cjc.im / posts / Minimal Viable Computer IV The Voyage Home

How minimal can we go? I have always toyed with designing a CPU, be it building a Z80 based machine, to writing emulators for made up systems.

I have been writing a simple emulator for a system that is a hybrid of Caxton Foster's Blue CPU, which had a massive 16 OPcodes, and introducing a simple "display" that is essentially a 32x32 monochrome screen.(that is easy to implement as a CLI system)

The Specs are as follows:

The instructions are mostly the same as the Blue CPU, except the Console Switch OP Code is replaced with a call that some ficticious display will "render" the screen.

An example program written in assembly for helloworld:

LDA 0x014
OUT
LDA 0x015
OUT
LDA 0x016
OUT
OUT
LDA 0x017
OUT
LDA 0x018
OUT
LDA 0x017
OUT
LDA 0x019
OUT
LDA 0x016
OUT
LDA 0x01a
OUT
HLT

Which would have the data for hello world after the halt. This program in hex is:

00000000  60 14 c0 00 60 15 c0 00  60 16 c0 00 c0 00 60 17  |`...`...`.....`.|
00000010  c0 00 60 18 c0 00 60 17  c0 00 60 19 c0 00 60 16  |..`...`...`...`.|
00000020  c0 00 60 1a c0 00 f0 00  00 68 00 65 00 6c 00 6f  |..`......h.e.l.o|
00000030  00 77 00 72 00 64                                 |.w.r.d|

In which you can see the required characters at the end of the binary dump

Currently I have the emulator working for most things. There is no assembler, but there is a disassembler built into the emulator.

Tags: minimalism development