It would be possible (a bit slow though). This has already been done a few times with JS. For example, qBasic (<a href="http://stevehanov.ca/blog/index.php?id=92" rel="nofollow">http://stevehanov.ca/blog/index.php?id=92</a>) or even virtualizing a whole device like the gameboy (<a href="http://www.codebase.es/jsgb/" rel="nofollow">http://www.codebase.es/jsgb/</a>).