Recently Notch (of Minecraft fame) anounced his new game: 0x10c. It is a space game. In this game you control your ship via a computer. This computer is the dcpu-16 . And this computer is fully programmable. Notch released the spec and a lot of tools have been released in the days after. I was immediately triggered by the spec and decided to build a javascript for this CPU. I took me a while but here it is: the javascript DCPU-16 simulator. You can find it on Github here: https://github.com/wasigh/Javascript-DCPU-16-simulator
I tried to fully test test the CPU. But still there are some bugs. Mainly because my misunderstanding of the spec. It was a fun project to do and I learned a lot about CPU’s and why a IFN will take an extra CPU cycle when it test fails. Hint: variable instruction length. Feel free to Fork it on github, post issues and send me pull requests.
A lot of discussion about DCPU-16 is over here: http://www.reddit.com/r/dcpu16