Tell me more ×
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.

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 reenigne.org, 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
3  
What is the metric here? – dmckee Jan 21 at 22:10
1  
added the code-challenge tag. every puzzle needs a 'type'. – luser droog Jan 22 at 5:06
2  
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 at 9:46
1  
In addition to a "type" every questions needs a way to tell who won or at least some basis for judging the entries. Without that this isn't a duplicate because it isn't a question in the mean we use here. – dmckee Jan 22 at 21:06
1  
... and most vitally winning criteria. – luser droog Jan 24 at 7:12
show 1 more comment

marked as duplicate by Peter Taylor, CMP, Sir_Lagsalot, grc, luser droog Jan 24 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.

1 Answer

C++ - 5084 lines

github.com/Alegend45/IBM5150/blob/master/cpu.h

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.