Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (25 sloc) 1.66 KB

A Python implementation of Notch's DCPU-16.

Complete with assembler, disassembler, debugger and video terminal implementations.

See for specification of the CPU.

Notch apparently started doing a 6502 emulator first. Given I did one in Python it only seems fitting I now do a DCPU-16 implementation in Python too :-)


Runs a number of example programs successfully. Should be feature-complete at the CPU level.

A dissassembler and (two) assemblers are also included as well as the emulator. The emulator includes a debugger.

  • ./ example.dasm16 example.obj will assemble Notch's example to object code
  • ./ example.obj will disassemble the given object code
  • ./ example.obj will execute it (but won't show anything without extra options)

There is also an experimental pyparsing-based assembler ./ contributed by Peter Waller. You'll need to pip install pyparsing to run it.

./ takes a number of options:

  • --debug runs the emulate in debug mode, enabling you to step through each instruction
  • --trace dumps the registers and stack after every step (implied by --debug)
  • --speed outputs the speed the emulator is running at in kHz
  • --term TERM specifies a terminal to use for text output (null, debug, curses, pygame or qt)

I'm working on an operating system for the DCPU-16 at and also plan an implementation of Forth at some point.


Now see