There's quite a few 8-bit CPU emulators that can be compiled to WASM. Static translation of 6502 (or Z80) machine code to WASM is tricky because a lot of 8-bit code was using self-modifying code, so you'd need at least some sort of JIT.
Shameless plug: I've started writing easy to integrate 8-bit chip emulators in standalone C headers a little while ago:
Shameless plug: I've started writing easy to integrate 8-bit chip emulators in standalone C headers a little while ago:
https://github.com/floooh/chips
For instance used in these WASM emulators:
http://floooh.github.com/tiny8bit