Building an NES Emulator

Programmer Michael Fogleman recently built
 his own emulator for the original Nintendo
Entertainment System. He's now put up a
post sharing many technical insights he learned
 along the way. For example: "The NES used
the MOS 6502 (at 1.79 MHz) as its CPU.

The 6502 is an 8-bit microprocessor that was
designed in 1975. ... The 6502 had no multiply
 or divide instructions. And, of course, no floating
 point. There was a BCD Binary Coded Decimal
mode but this was disabled in the NES version of
the chip—possibly due to patent concerns. The
 6502 had a 256-byte stack with no overflow
detection. The 6502 had 151 opcodes of a possible 256.
 The remaining 105 values are illegal / undocumented
opcodes. Many of them crash the processor.




But some of them perform possibly useful results by
 coincidence. As such, many of these have been given
 names based on what they do." It's an interesting look
 at how software and hardware interacted back then,
 and what it takes to emulate that in modern times.
Fogleman released the source code on GitHub.