A 6502 CPU emulator for .NET
.NET cross-platform libraries and applications for executing 6502 CPU machine code, and emulating specific computer systems (such as Commodore 64) in different UI contexts — browser, desktop, and headless.
Important
This is mainly a programming exercise that may or may not turn into something more. See Limitations below.
Full documentation lives at https://highbyte.github.io/dotnet-6502/docs/ — apps, libraries, tools, systems, and development guides.
| Avalonia WebAssembly | Blazor WebAssembly |
|---|---|
![]() |
![]() |
- Desktop apps for Windows, Linux, and macOS — Avalonia, SadConsole, and SilkNet variants. See Desktop apps.
- Headless app for automation, scripting, and CI workflows — no UI, controlled via CLI and Lua. See Headless.
- VS Code debugger extension for source and disassembly debugging of 6502 code. See VSCode debugger.
- Lua scripting for driving the emulator — selecting systems, controlling emulation, reading/writing memory, injecting input. See Scripting.
- TCP remote control lets external processes inspect and drive a running emulator over a newline-delimited JSON protocol. See Remote control.
- C64 Basic AI code completion in the Blazor browser app. See AI code completion.
Published as NuGet packages under Highbyte.DotNet6502.* — a core CPU library, system emulation libraries (Commodore 64, Generic), and per-host I/O implementations (Avalonia, Blazor, SadConsole, SilkNet, etc.). See Libraries for the full catalog and architecture.
Important
- Correct emulation of all aspects of computers such as the Commodore 64 is not likely.
- Not the fastest emulator.
- A real Commodore 64 uses the 6510 CPU; for the purpose of this emulator the 6502 is treated as equivalent (same instruction set).
- Code coverage is currently limited to the core
Highbyte.DotNet6502library.
For the full list of missing features and constraints, see Limitations.
- Kristoffer Strube for the original Blazor WASM async interop code for WebAudio, DOM, and IDL that was the basis for a synchronous implementation in this repo. Copyright notice here.


