Notch's Specification for the In-Game DCPU-16
Just waiting for the first post about programming this CPU to pop up on Stack Overflow ... :)<p>It's quite an interesting architecture. From an initial perusal, I found these features note-worthy:<p>* Explicit access to PC as a register, makes "computed goto" trivial and very natural.<p>* Because of the above, there is no JMP instruction.<p>* Treating operations on registers as "values" makes the instruction set very orthogonal.<p>* No instructions for bit-manipulation.<p>* Lots of possible NOP instructions, like "SET PC,PC" (which I <i>think</i> should work, depends a bit on exactly when it's incremented but it looks safe).<p>* Word-addressed memory will make string processing interesting to implement. Maybe in space, everyone uses UTF-16.<p>* Single 64 K address space will put quite the limit on the amount of code, I guess the game will show how much code is needed to do anything.<p>* No I/O instructions means I/O must be memory-mapped, further reducing the space available for code. Maybe there will be bank-switching?<p>* No interrupts.