The GHOST Simulator set

09/16/2025 - github/Ghost

Ghost is a computer architecture I made as a thought experiment, and also as an easy way to introduce people to the ideas of assembly. I've dubbed it a 'fantasy CPU': think a 'fantasy console' except it's just a CPU architecture.

This project has many components, each in their own folder.

Simulator

This is the heart of the projects. It steps through given programs and executes them, drawing on the screen, and handling other IO. It also includes a debugger, with breakpoints, and a full memory and register inspector that also helps parse the hardware stack pointers. Features such as: break on access of a certain memory location, manually editing registers, and arbitrary jumps are planned, but not yet implemented.

Assembler

This is the go-to home for development for GHOST. It takes the custom assembly language, and converts it to bytes for the simulator to execute. See the docs for the instruction set, and other notes on the architecture such as memory layout.

Programs

Various assembly programs, including:

Lang

The beginnnings of a C compiler, built in python, targeting GHOST

Hmm

This is a WIP circuit-level logisim model of the GHOST computer. As of the most recent change, I believe many core instructions are implemented. However I haven't added interrupts yet, and graphics might be impractical, given the speed of the simulation.

Docs

Documentation, including to-do lists, system architecture notes, IO notes, memory layout notes, instruction set notes, program notes, and more scattered notes. Also contains various helper files: sublime syntax highlighting for the assembly, sublime build system for assembly, a script to read the instruction set from the docs and parse it into cpp code, then inject it into the simulator source code.

Huge progress

09/16/2025

While not accompanied by a release, it's been over a year since the last update!


So much has changed, a changelog would be impracticle. It seems more reasonable to instead list the features of the new elements!


In the C++ simulator, we now have a debugger, featuring:

The assembler remains largely unchanged, except for bugfixes. However I'm working on adding a whole new way of programming for GHOST: a C compiler!

And, a new way to run your code as well, thanks to a logisim simulation!

Complete Rewrite!

04/05/2024 - Release 3

After loads of incremental changes, a complete rewrite, and then even more changes we've arrived at Release 3!

Efficiency and speed greatly improved

04/25/2023 - Release 2

Mostly just performance changes.

Upload of old version: Ghost 18!

04/06/2023 - 8Bit.cv - Ghost 18.zip - Documentation

This is an upload of an old version, but it's special enough to deserve an upload because it comes with a bit of a bonus: it has a circuit simulator to go with it. Attatched is a circuitverse file that will let you watch how the computer works in real-time! However, I cannot remember how many of the instructions are implemented, nor how effectivly. Nevertheless, it was an amazingly fun project that whiled away many hours.

Also attached is a very cool piece of what I'm calling 'live documentation'. Attatched is a python script that has some pretty cool capabilities, listed below:

Index

This is the most interesting one! Loops through the whole database and reads the information from it to store in the reference file. However, it also recompiles the micro ASM, a simple simple language, into the microcode. The micro ASM is a list of symbols seperated by commas that are intended to be human readable, where an arrow designates a move from one location to another, and special codes are 4 bit data prefixed with the code 'area'. There are two areas, MF for math flags, and MC for mini commands. The mini commands are commands that don't need a 'to' and 'from' section, so can be seperated from the rest. The microcode architecture is built such that the first four bits are the 'from' or the area code, while the last four bits are the 'to' section or, if in an area, the instruction within the area. This 'index' command validates the microcode, checks the unique assembly name, and saves all of it to the reference file.

ROM Creator

The rom creator takes information stored in the reference file and compiles the microcode into a ROM for the simulated computer

Compiler

Missnamed by ignorance, this assembler uses the reference file to assemble into a hex format that can be pasted into the circuitverse simulator.

Simulator

Because it doesn't have a screen, this release of Ghost uses a beautiful python-curses terminal simulator that can display tons of information at once, including decoding the microcode instructions for each instruction and a cool scrolling memory dump.

First release of GHOST!

01/05/2023 - Release 1

Running todo list:

Changlog: