Programming Puzzles & Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Emulate an Intel 8086 CPU

I know that there already is a code golf for this, but that one didn't require much. This one, however, is for masochists only! >:) OK, you need to emulate an entire 8086, every single opcode. Not every flag needs to be computed, but every single documented opcode needs to be implemented.

However, that's just the beginning. I STRONGLY encourage you to support more than just this. NEC V20? Why not? Soviet clones? Don't mind if I do.

For some help, opcodes 0x60 - 0x6F are just aliases for opcodes 0x70 - 0x7F on the 8086 and 8088 ONLY. If you ask the guy who runs, he'll say the same thing, simply because it's been proven by hardware tests, on an IBM XT.

Anyways, for bonus points, emulate an entire V20, 286, or 386, no facets left unemulated.

share|improve this question

marked as duplicate by Peter Taylor, captncraig, Sir_Lagsalot, grc, luser droog Jan 24 '13 at 7:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

What is the metric here? – dmckee Jan 21 '13 at 22:10
added the code-challenge tag. every puzzle needs a 'type'. – luser droog Jan 22 '13 at 5:06
The other thread you mention is Emulate an Intel 8086 CPU‌​, and I'm voting to close as a duplicate of that on the basis that any solution to this challenge is also a solution to that challenge. If you want solutions to the extended challenge to get double points, I think a better approach is to find someone willing to sponsor bounties. – Peter Taylor Jan 22 '13 at 9:46
Minority Opinion: I don't consider it a problem to have an expanded version of the same challenge. Something you can graduate towards by first solving the smaller one. But I cast the final close vote as "Not a real question" for the reason cited by dmckee. The beauty of the original question was the well-chosen subset and the well-written test program which exercised the desired subset. Where does this one end? Pentium? MMX? The fun was in the 0-60 part. That said, if this were edited to provide nicer constraints, perhaps a single output device, and a testing program, that'd be different.hth – luser droog Jan 24 '13 at 7:09
... and most vitally winning criteria. – luser droog Jan 24 '13 at 7:12

C++ - 5084 lines

This emulates the entire 8086, the 80186 instruction set, and part of the NEC V20. This took me over 3 weeks.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.