A CPU written in C
It's assembler was going to be written in C, but C is hard so then I started writing it in Rust, but the borrow checker wants me dead so now it's written in Go
Or maybe I'll rewrite it in Zig
See architecture.md for, you know, the CPU architecture
See call_codes.md for the CPU call codes for syscalls
The casm/
folder is the assembler
cpu.c
and lib.h
is the CPU itself
The asm
folder contains all the assembly I wrote for the CPU(.asm
files contain plaintext source code, .bin
files contain the assembled code)
NOTE: These instructions are meant for Unix systems
Installing Casm
- Check if you have Go with
go version
If not, either download it with Homebrew(
brew update && brew install go
) or from Go's website - Run
go install github.com/voidwyrm-2/ccpu/casm@latest
; usecasm -h
for help with assembling files
Installing The CCPU
The CCPU must be built from source because I'm lazy and it's not that hard
- Get a C compiler(I reccomend either gcc or clang)
If you already have a C compiler that you like, use that one, I only care that you have one
- Download this repo
- Run compile
cpu.c
with-o ccpu
; useccpu -h
for help with running files