Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
8086tiny: The world's smallest PC emulator (megalith.co.uk)
79 points by galapago on Jan 22, 2014 | hide | past | favorite | 6 comments


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.


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


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


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?


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

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


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: