Silly question, but is there an x86 instruction set emulator written in JavaScript? Not even Linux, just something that takes x86 instructions into a "virtual CPU" and lets you run the assembly statements?

Yep, v86 [0] is what you're looking for!

There's even a demo with Linux 3. [1]

[0] https://github.com/copy/v86 [1] https://copy.sh/v86/?profile=linux3