Skip to content
Przemyslaw Rachwlal edited this page May 4, 2026 · 2 revisions

CmosCpu Simulator

Educational 8-bit CPU simulator inspired by CMOS/TTL-based computers. Built with .NET 10, C#, clean architecture, and modular design.

Features

  • 8-bit CPU with 16-bit address bus
  • Minimal instruction set (17 instructions) plus full MOS 6502 emulation
  • Memory-mapped I/O: LED, Timer, RTC DS3231, UART, LCD HD44780, I2C
  • Interrupt handling: IRQ, NMI, RESET
  • Text assembler with label support
  • Full MOS 6502 emulation (56 official opcodes, decimal mode, interrupts)
  • Machine modules: Apple-1, KIM-1, Minimal Blink, Retro70
  • Avalonia UI desktop frontend (cross-platform)
  • Cycle-accurate device ticking
  • DI-friendly architecture with NLog logging
  • 400+ unit and integration tests

Quick Start

# Build
dotnet build

# Run tests
dotnet test

# Launch UI
dotnet run --project src/Symulator.Avalonia

Project Structure

CmosCpuSimulator/
├── src/
│   ├── CmosCpu.Core/              Core interfaces and types
│   ├── CmosCpu.Bus/               System bus implementation
│   ├── CmosCpu.Memory/            RAM, ROM, MemoryMap
│   ├── CmosCpu.Cpu/               CPU cores (educational + MOS 6502)
│   ├── CmosCpu.Devices/           I/O devices
│   ├── CmosCpu.Assembler/         Text assembler
│   ├── CmosCpu.Runtime/           Machine builder and DI wiring
│   ├── CmosCpu.Computer/          Universal computer abstraction
│   ├── Symulator.Application/     Application layer
│   ├── Symulator.Machines.Apple1/ Apple-1 machine module
│   ├── Symulator.Machines.Kim1/   KIM-1 machine module
│   ├── Symulator.Machines.MinimalBlink/  Minimal Blink machine module
│   ├── Symulator.Machines.Retro70/       Retro70 machine module
│   └── Symulator.Avalonia/        Avalonia UI frontend
├── tests/                         400+ tests (MSTest + Moq + FluentAssertions)
├── profiles/                      Machine configuration profiles
├── programs/asm/                  Example programs with solution manifests
├── roms/                          ROM binaries
└── docs/                          Documentation

Architecture

Clean architecture with strict dependency flow:

Core → Bus → Memory → Cpu → Devices → Assembler → Runtime → Computer → Application → Machines → Avalonia

License

MIT

Clone this wiki locally