Join GitHub today
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
DCPU-16 Playground This is an emulator, assembler, and a (still primitive) implementation of the Forth programming language for notch's DCPU-16. See: http://0x10c.com/doc/dcpu-16.txt The emulator is written in C, the assembler (masm) is Python, and the real fun starts in forth.dasm and forth.ft. In order to get up and running, I've augmented the DCPU instruction set with four new instructions (all in non-basic format): kbd: check for a keypress, store the ascii code in the 'a' argument out: emit the ascii code in the 'a' argument to the terminal img: dump ram to the file core.img, from address 0x0000 to (but not including) the address in the 'a' argument. if 'a' is 0, dump the entire heap (0x0000 to 0x10000) die: exit the emulator dbg: enter the emulator debugger The latter two instructions are only used in special cases and are easily avoided. img is needed only to bootstrap the forth image. The first two, however, are required in order to both bootstrap and run the provided forth image, so forth.img is not portable to other emulators unless they implement kbd and out. The built-in disassembler includes code from Brian Swetland's DCPU-16 emulator, see the file disassemble.c for license and copyright info. To build, just run: make To run the forth.img: ./forth Other images can be run with: ./dcpu blah.img