News for hackers. Stuff that matters.
Re:Show HN: My x86 emulator written in JavaScript by dbancajas on Thursday October 17, 2013 @06:22PM (#6568569)
I want to write an emulator as a learning experience. Any tips how should I start?
Re:Show HN: My x86 emulator written in JavaScript by awy on Thursday October 17, 2013 @08:10PM (#6569034)
I recently posted about emulating the NES with JavaScript.

http://blog.alexanderdickson.com/javascript-nes-emulator-par...

Part 2 will be posted when it's done. :)

If you want to get something done much quicker, have a go at emulating the Chip-8 VM.

I also have a post, but it's less hand-holding than the first.

http://blog.alexanderdickson.com/javascript-chip-8-emulator

Good luck!

Re:Show HN: My x86 emulator written in JavaScript by vinhboy on Friday October 18, 2013 @02:24AM (#6570074)
I really like your tutorial. I been trying to learn assembly and your tutorial is really helping me put the big picture together. I hope you continue to work on making it better.
Re:Show HN: My x86 emulator written in JavaScript by awy on Friday October 18, 2013 @04:26AM (#6570327)
I have a heap on my plate right now but will hope to do part 2 before the end of the year. Glad you enjoyed it.
Re:Show HN: My x86 emulator written in JavaScript by n1ghtmare_ on Sunday October 20, 2013 @06:16AM (#6579461)
I'd like to think of myself as an experienced programmer, but I still loved your tutorial ! Brilliant ! Keep up the good work.
Re:Show HN: My x86 emulator written in JavaScript by g3 on Thursday October 17, 2013 @07:07PM (#6568773)
Re:Show HN: My x86 emulator written in JavaScript by revelation on Thursday October 17, 2013 @06:56PM (#6568735)
You want to write an emulator, but you probably don't want to write one for x86. A nice architecture would be 8 bit AVR microprocessors, for example.
Re:Show HN: My x86 emulator written in JavaScript by JoshTriplett on Thursday October 17, 2013 @06:31PM (#6568608)
There are two sensible approaches: interpretation or dynamic translation.

If you want to write one as a learning experience for how the platform you're emulating works and how an emulator could work in principle, you probably want to write an interpreter: find out how the platform boots, build something to start reading and interpreting instructions, start adding emulated hardware devices, and you'll get an increasingly functional interpreter.

For a start, you could ignore emulation of devices, and just write a CPU core that interprets instructions.

If you want to learn how modern (but still non-hardware-assisted) emulation works, read about how qemu's dynamic code translator and other JIT compilers work, and build a CPU emulator based on that.

Re:Show HN: My x86 emulator written in JavaScript by dave84 on Thursday October 17, 2013 @06:36PM (#6568626)
I'm not the OP but check out the book: "The Elements of Computing Systems: Building a Modern Computer from First Principles" It's quite comprehensive, not exactly about writing an emulator, but it should give you what you need.
Re:Show HN: My x86 emulator written in JavaScript by ghewgill on Thursday October 17, 2013 @06:34PM (#6568620)
Re:Show HN: My x86 emulator written in JavaScript by joelanders on Thursday October 17, 2013 @06:40PM (#6568651)