back
15 comments
Hi guyz, I'm the author of this project, but not the author of this post. Indeed the project is very incomplete and indeed it's "disassembler" - not "decompiler" :) I plan to talk about it on HN when I'm satisfied with the results (and when the emulator starts outputting things)... today was a little early.

Thanks though for the upvotes and the kind remarks!

Cheers and happy 2017!

TLDR:

* There is no emulator

* This appears to be a work-in-progress project.

* The 'decompiler' is actually a disassembler

* Only supports a tiny subset of opcodes.

This is fantastic! I wish this existed back when I did my emulator-baked remakes experiment [1]. May use this as the foundation for the next iteration!

[1] http://gabrielgambetta.com/remakes.html

It seems nice, but the actual disassembler doesn't seem to work here:

http://xem.github.io/minix86/decompiler.html

is there any specific browser or OS requisite?

The "choose file" button works, but then nothing happens, and all the "built-in" examples buttons do nothing.

it should work on any modern browser. Warning though, the url has changed a little: see https://github.com/xem/minix86
Ok, still this:

https://xem.github.io/minix86/src/disassembler.html

doesn't work for me, maybe by "modern" you mean a current Chrome or Firefox.

I tested it with QTweb, Chrome 43 and Opera (Presto), certainly not the most "mainstream" or "popular" or "latest" browsers around, still I find no real reason why the thingy shouldn't work with them.

I just tested on Chrome, Firefox and Edge (W10) and it works fine everywhere. Do you have an error showing up in your console or something?
In Chrome 43 (Ok, Iron Browser) I get two errors:

Uncaught SyntaxError: Unexpected token =>helpers.js:10

Uncaught SyntaxError: Unexpected token =>demos.js:2

Basically the first two actual instructions are not parsed correctly.

In Opera (12.15) I have three errors:

Syntax error at line 10 while loading: expected expression, got '>' var to16 = (n, l) => { -------------------^ Linked script compilation helpers.js Syntax error at line 38 while loading: invalid character after numeric literal: 'b'. n = b & 0b1111; -------------^ Linked script compilation disassembler.js Syntax error at line 2 while loading: expected expression, got '>' hello.onclick = e => { -------------------^ Linked script compilation demos.js

This is not a decompiler but a disassembler. See[0] for futher details.

[0]: https://en.wikipedia.org/wiki/Decompiler

I was also a bit disappointed to see that, since a decompiler is far more interesting (and complex). But decompilation involves disassembly (in particular, one that follows the execution flow) so at least it's a start...

As discussed at https://news.ycombinator.com/item?id=9321698 , "write a disassembler at least once" is a good exercise and not particularly hard even for x86, because a lot of the instructions follow common patterns (easier to see in octal.)

Why use Javascript for this?
Atwood's Law [1] ... Mainly because the web browser is the single most broadly available interface with JS being the most accessible language to use in that interface. There are definitely other JS x86 emulators out there. JS isn't the fastest available, but it's far closer to run everywhere.

[1] https://blog.codinghorror.com/the-principle-of-least-power/

Mainly for fun and because I like this language. Also, my goal is to let people drop a x86 demo in their browser and just watch it play or interact with it without any other tool.