A JavaScript 65816 Microprocessor Emulator
Go to file
2011-05-05 17:25:44 -04:00
test started adding test cases for the emulator, I've decided upon using QUnit for the tests 2011-05-05 17:25:44 -04:00
.gitignore updated the TODO and added a .gitignore so my vim *swp files don't accidently wind up in here 2011-04-30 22:24:57 -04:00
cpu.js started adding test cases for the emulator, I've decided upon using QUnit for the tests 2011-05-05 17:25:44 -04:00
index.html initial commit 2011-04-30 21:45:56 -04:00
README have the examples make sure the registers are 16-bit 2011-05-05 11:11:58 -04:00
TODO updated the TODO 2011-05-05 11:00:59 -04:00

This project's goal is to fully emulate the 65816 microprocessor in JavaScript.  It would be awesome if at some point it could emulate an entire system such as the SNES, but that is something to consider later on. 

You call the execute function of the cpu object with a raw hex string representing the program you wish to emulate and it will execute those instructions as close to the 65816 as possible.

Short examples to try out:

var cpu = new CPU_65816();

cpu.execute("18fbc230a9ff0185ff64ffa5ff");

cpu.r.a should be 0 after executing this.

cpu.execute("18fbc230a9ff01a0010099fea5ff");

cpu.r.a should be 511 after executing this.

cpu.execute("18fbc230a900001ad0fd")

This will loop until 0 is incremented past 0xffff and overflows back to 0.

cpu.execute("18fbc230a9ffff3a30fd")

This will loop until 0xffff is decremented to 0x7fff and then stops.