Cat Machine is a project where we have designed a custom CPU architecture called "Cat CPU" and implemented it as a virtual machine as full toolset.
You can read more about this project on the GitHub Wiki Page.
- 32bit CPU.
- Simple architecture designed to be easy to remember and understand.
- Designed to mimic an old game console.
- Designed for making simple games.
The Cat VM is where you'll be running your applications. It simulates the architecture and provides debugging tools.
It lives in the CatVM folder.
The Cat Assembler is an assembler for a custom flavour of assembly language designed specifically for this project. It assembles into a binary file which represents the ROM which is loaded into memory on startup.
It lives in the CatAssembler folder.
Catnip is a high-level programming language designed specifically for programming the Cat VM. It compiles into Cat Assembly.
It lives in the Catnip folder.
CatLLVM is an LLVM-IR backend for the Cat VM. It accepts LLVM IR text
(.ll) and emits Cat Assembly, letting you target CatVM from any LLVM
frontend (clang, rustc, etc.):
clang -S -emit-llvm -O0 -m32 -ffreestanding -nostdlib \
-target i386-unknown-none source.c -o source.ll
dotnet run --project CatLLVM -- source.ll -o source.cat
dotnet run --project CatAssembler -- source.cat -o source.bin
dotnet run --project CatVM -- source.bin
It lives in the CatLLVM folder. See CatLLVM/README.md for the supported
IR subset and calling convention; see ExampleProjects/LlvmTest/ for
worked examples.