https://github.com/jtauber/dcpu16py
A Python implementation of Notch's DCPU-16 (complete with assembler, disassembler, debugger and video terminal implementations)
https://github.com/jtauber/dcpu16py
dcpu16
Last synced: 10 months ago
JSON representation
A Python implementation of Notch's DCPU-16 (complete with assembler, disassembler, debugger and video terminal implementations)
- Host: GitHub
- URL: https://github.com/jtauber/dcpu16py
- Owner: jtauber
- License: mit
- Created: 2012-04-04T21:02:33.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2014-07-15T17:07:48.000Z (almost 12 years ago)
- Last Synced: 2025-04-07T23:36:15.878Z (about 1 year ago)
- Topics: dcpu16
- Language: Python
- Homepage: http://jtauber.github.com/dcpu16py/
- Size: 350 KB
- Stars: 192
- Watchers: 5
- Forks: 22
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A Python implementation of Notch's DCPU-16.
Complete with assembler, disassembler, debugger and video terminal implementations.
See http://0x10c.com/doc/dcpu-16.txt 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 :-)
## Status
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.
* `./asm.py example.dasm16 example.obj` will assemble Notch's example to object code
* `./disasm.py example.obj` will disassemble the given object code
* `./dcpu16.py example.obj` will execute it (but won't show anything without extra options)
There is also an experimental pyparsing-based assembler `./asm_pyparsing.py`
contributed by Peter Waller. You'll need to `pip install pyparsing` to run it.
`./dcpu16.py` 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
[https://github.com/jtauber/dcpu16os](https://github.com/jtauber/dcpu16os) and also plan an
implementation of Forth at some point.
## Examples
Now see [https://github.com/jtauber/DCPU-16-Examples](https://github.com/jtauber/DCPU-16-Examples)