4 ms·
Writing an x86 emulator in JavaScript
- mietek 11y agoHere’s another one: http://bellard.org/jslinux/ http://bellard.org/jslinux/ https://github.com/levskaya/jslinux-deobfuscated https://github.com/levskaya/jslinux-deobfuscated
- jevinskie 11y agohttps://github.com/copy/v86 https://github.com/copy/v86 has a MIT license.
- benbristow 11y agoWriting an x86 emulator to run in javascript on an x86 machine. (although of course this would work on ARM etc. too). Pretty cool though in all fairness.
- aappleby 11y agoI know you're not too interested in performance here, but replacing DataView with a Uint8Array will probably get you a 10x+ win - DataView is extremely slow and V8 can't optimize calls to Program.getUint8(PC) in the same way that it can optimize Program[PC].
- tadeuzagallo 11y agoThanks, indeed I didn't make any efforts to make it faster, but this seems fair... I honestly didn't know DataView was that slow, it got fibonacci(40) down to 1m53s. Faster than PERL according to http://fengmk2.com/blog/2011/fibonacci/nodejs-python-php-ruby-lua.html http://fengmk2.com/blog/2011/fibonacci/nodejs-python-php-rub...