Skip to content
copokbl edited this page May 11, 2026 · 2 revisions

Welcome to the Cat Machine wiki!

Cat Machine is a project that defines a 32bit CPU architecture, implements it in a VM, and implements an assembler for a custom assembly language. The inspiration behind this project is old consoles, the idea is that you can write a game or application using our ASM and then run it with a limited CPU clock rate to simulate poor hardware, this means that you can focus on optimisation knowing that it will mean something.

Pages

  • Registers – the encodable and non-encodable register file, plus the flags layout.
  • Instructions – every opcode, its operand encoding, cycle cost and privilege requirement.
  • Memory – memory layout at boot, the stack, bounds checking and the ROM/reset behaviour.
  • Virtual Mode – the user/kernel privilege model, address translation, and the interrupt frame format.
  • Interrupts – the standard interrupt numbers, the handler-table format and iret.
  • Serial Protocol – how the VM talks to virtual peripherals.
  • Display – display modes, palettes, tiles and sprites.
  • Assembly – syntax for the Cat assembler, including macros, includes and debug symbols.
  • Catnip Programming – the higher-level Catnip language that compiles down to Cat assembly.

The VM

The VM allows configuring the CPU cycles per second, the available memory, and the available debugging tools. You pass the VM a ROM file, which is then loaded into memory and execution begins at address 0.

The Assembly

The assembler supports most modern assembler features like assemble-time constants and expressions, #include, macros, reserving and defining raw data, including raw data files, etc. Every assembled ROM is paired with a JSON debug-symbol file so debuggers and other tooling can show source lines and symbolic addresses.

Clone this wiki locally