<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>billforsternz</author><text>One of my best hacks back in the day was an 8080 emulator, for the 8088&amp;#x2F;8086 back in the time when what you were really trying to do was run the 8080 code as fast as possible (because the first PCs were slow, and emulating 8080 code was much slower than running 8080 code on a native machine).&lt;p&gt;Invariably at the time the 8080 emulators would have a dispatch loop, fetching the next opcode and dispatching through a jump table to some code to emulate each of the 256 opcodes. One problem with this was that you couldn&amp;#x27;t dispatch this way without altering the CPU flags, so you&amp;#x27;d also have to save and restore those with LAHF&amp;#x2F;SAHF (fast) or PUSHF&amp;#x2F;POPF (slow). In general you&amp;#x27;d need about 10 8086 instructions to emulate 1 8080 instruction, and in the early 1980s this meant your emulated CP&amp;#x2F;M program would run much slower than on your old CP&amp;#x2F;M computer.&lt;p&gt;My emulator would emulate 1 8080 opcode with 4 8086 opcodes as follows; An 8080 instruction, say 0x94 = sub h would be emulated with code loaded at address 0x9494. That code would be;&lt;p&gt;&lt;pre&gt;&lt;code&gt;  sub bh,dl   ;bh = bh-dl, emulate h with bh, a with dl
  lodsb       ;al = *si++, get next opcode, increment emulated pc
  mov ah,al   ;eg 0x94 -&amp;gt; 0x9494
  jmp ax      ;jump to next instruction
&lt;/code&gt;&lt;/pre&gt;
This is a classic example of trading space for time, your emulator is sparsely distributed through 64K of RAM. So you needed 128K to emulate your 64K 8080.</text><parent_chain></parent_chain></comment><story><title>Intel 8080 emulator. 19th IOCCC. Best of Show</title><url>https://nanochess.org/emulator.html</url></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>wzdd</author><text>Related, 8086tiny, a 2013 IOCCC winner. About twice as much source code, and if not cheating then certainly leaning heavily on the rules, but very impressive as it&amp;#x27;s a full x86 emulator with graphics and several peripherals.&lt;p&gt;Original entry: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.ioccc.org&amp;#x2F;years.html#2013_cable3&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.ioccc.org&amp;#x2F;years.html#2013_cable3&lt;/a&gt;&lt;p&gt;&amp;quot;Deobfuscated&amp;quot;: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;adriancable&amp;#x2F;8086tiny&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;adriancable&amp;#x2F;8086tiny&lt;/a&gt;&lt;p&gt;(Not mine, just a fan)</text><parent_chain></parent_chain></comment><story><title>Intel 8080 emulator. 19th IOCCC. Best of Show</title><url>https://nanochess.org/emulator.html</url></story>