Two ideas for I/O in DCPU-16
There was a comment about possibly adding a fake "putchar" opcode until Notch adds I/O. This is OK, but it instantly creates machine code incompatibility with the "real" machine and breaks the spec. Here are two possible alternatives:
- Due to the programmability of the PC register, there are plenty of NOP instructions. Have your VM treat one or two of these forms differently. For example, you might have one that is interpreted as doing a putchar of the contents in register A.
- Reserve some bytes in memory and use memory-mapped I/O.
Sure, both of these would still have to be changed later, but they would both ensure that your code still RAN on the actual DCPU-16 code in the game.
Any other ideas?
1 comment
[ 2.8 ms ] story [ 10.0 ms ] threadYou should post it over at http://www.reddit.com/r/dcpu16