Is there an assembly simulator
in JavaScript
available?
If not, would it be feasible and realistic to make one?
Is there an assembly simulator
in JavaScript
available?
If not, would it be feasible and realistic to make one?
Yes there is the Javascript PC Emulator
And here there is written what it's emulating: Javascript PC Emulator - Technical Notes
This PC emulator is written in Javascript. The emulated hardware consists in the following devices:
32 bit x86 compatible CPU
8259 Programmble Interrupt Controller
8254 Programmble Interrupt Timer
16450 UART
Real Time Clock.
and
The CPU is close to a 486 compatible x86 without FPU.
Probably the CPU emulator is here: http://bellard.org/jslinux/cpux86-ta.js I've read it's quite simple to read after passing it under a Javascript beautifier, but remember the license!
I haven't watched it (because it's minified and I'm too much lazy to beautify it) but I'm quite sure the real-mode emulator will be minimal, just the strict necessary to bootstrap linux, so I'm not sure you would be able to run a DOS there, and there is the possibility the console has been "bolted" on to connect it to the browser window, so I'm not sure you could have a "real" console. Mmmh... Now I've noticed. It doesn't have a graphical adaptor. It uses the emulated serial port to connect to the browser and show the output. Still the question of the OP was quite precise :-)
I'll add that there is at least a NES emulator written in Javascript. I won't give the URL (just to be sure... These emulators are always at least in the gray line), but its name is jsnes
. Now, the NES had a CPU (a Ricoh 2A03 8-bit for the NTSC version and a Ricoh 2A07 8-bit for the PAL version), so the emulator quite surely emulates the CPU :-)