DcpuSharp is an implementation of the DCPU-16 processor in C#. It is first intended to provide a programatic way for simulating DCPU-16 programs. There is a EXE project called DcpuTest that runs the sample program.
When creating the Cpu object, it must be given the inital contents of memory. One instruction is executed for each call to Tick().
ushort[] memory = new ushort[] { /*...*/ };
var cpu = new Cpu(memory);
while (true)
{
cpu.Tick();
Console.WriteLine(cpu.Status());
Thread.Sleep(250);
}
- .NET Framework 4.0. It should also compile against 2.0.
DcpuSharp is licensed under the BSD license.
- Does not support the unofficaly instructions or memory mappings for IO.
- A nicer front end for loading and executing programs.
- An API for emiting instructions. The goal is for the API to feel similar to System.Reflection.Emit.
- An assembler that uses the emit API.
- Support for I/O.
- Support for counting cycles.