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.