The GHOST Simulator set

04/05/2024 - github/Ghost

Quick preface: this description describes the program as it was a couple years ago, and I haven't had time to update it as fully as I would like to. It's close, but most components have been completely rewritten since then and operate with significant changes.

Ghost is a computer archecture I made as a thought experiment, and also as an easy way to introduce people to the ideas of assembly. It's both the definitions I've created, and a collection of python/c++ scripts including an assembler and simulator.

The assembler runs in two passes: the first pass clears comments, resolves shorthand, validates the instructions, and records labels. The second pass fills in the labels, does math, and validates each byte to ensure the hex is ready to be output. Then it's output in a variety of formats. Additionally, the compiler supports basic definitions, data definition, labels/names, 5 different output formats, and a dictionary called 'debugging' that allows you to configure the differrent debugging features.

The other main program is the simulator. It loads each instruction from memory, converts it to it's mnemonic, and executes it in an el/if tower. It automatically process writes to screen memory, key inputs, reads from the random IO device, halts, and breaks. Other assorted tools are: Sublime Text syntax highlighting, downloader to get current information from the notion document, and a few example assembly programs.

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: