
8086tiny: The world's smallest PC emulator - galapago
http://www.megalith.co.uk/8086tiny/
======
EvanAnderson
This is pretty cool.

I didn't look at the IOCCC contest entry, but I can see the influence of the
IOCCC rules on this code for sure. Having lookup tables in the BIOS binary to
handle instruction decode seems bizarre to me (other than to get the code size
under the IOCCC maximum). It has the effect of splitting the source code for
the emulator between the C source and the BIOS assembler source. It evokes a
feeling of the CPU microcode being stored in the BIOS.

------
sehugg
Guess this is a good candidate for Emscriptening? (if it hasn't happened
already)

~~~
Zardoz84
I have running a computer in javascript via emscripten (cpu.zardoz.es), so
should work with 8086tiny

------
VikingCoder
Maybe I'm going about it all wrong, but I'm having a hell of a time compiling
in Microsoft Visual Studio.

Anyone else having luck?

------
donquichotte
Small, but probably not the smallest: An 8086 PC emulator in 4043 bytes [1]

[1]
[https://news.ycombinator.com/item?id=7012385](https://news.ycombinator.com/item?id=7012385)

~~~
acegopher
It's the same one referenced there, only non-obfuscated and commented. From
the OP:

An obfuscated version of 8086tiny (condensed into just 4043 bytes of C code)
was a winner of the 2013 IOCCC contest. Significant interest followed for a
documented, commented, maintainable version. The result is the distribution
presented here.

