8-bit in the browser
You know what: if I'm going to show off my progress here on my website, I might as well build the 8-bit machine to work in the browser.
How does it work?
With a bit of experimentation, you should be able to figure out what the machine is doing, so I'm not going to explain anything. That's not to say I can't help you along a little bit. I may be withholding the answers, but I'll gladly provide the questions.
- What does
ADDadd? - What does
SWAPswap? - Why does the IP register sometimes increase by 1 and sometimes by 2?
- Why does
JUMP 4jump to the third instructions? - What does the machine calculate?
- Why does
ADDgive weird results after a while?
Hacking
If you know your way around your browser's developer tools, you can change the program the machine is running. You only have a tiny instruction set to play with, mind. I mean, it doesn't even include instructions for manipulating memory; all you get, is two general purpose registers. If limitation breeds creativity, I expect this machine to lead to some of history's greatest works of art.