3 ms·
I did for my emulator jor1k. Take a look: https://github.com/s-macke/jor1k/blob/master/js/worker/or1k/fastcpu.js https://github.com/s-macke/jor1k/blob/master/j
by s-macke 11y ago
I did for my emulator jor1k. Take a look:
https://github.com/s-macke/jor1k/blob/master/js/worker/or1k/fastcpu.js https://github.com/s-macke/jor1k/blob/master/js/worker/or1k/...
Handwritten asm.js code. Around 10 hours or porting time.
- Sephr 11y agoThat's quite an impressive implementation! I didn't realize hand-written asm.js could be that readable.
- s-macke 11y agoYes, more or less. Every operation must be written, that the type is obvious for the compiler. And you have one array, the heap with some special index rules. For example: (r[((ins >> 9) & 0x7C)>>2]|0 The >>2 and |0 is necessary.