Reputation: 1
I want to write an IBM-PC compatible emualtor with C++ as an educational project, and in order to correctly emulate the 8086 processor need information on how it works.
Some examples for the information I would need:
How is the code structured (size of single instructions, how are they unpacked, etc.)
Exact workings of the registers
Detailed information on what the single instructions do (For example the default description for the CMP command "Compares ... and ... and sets the flags" isn't enough for me)
I have already searched around for a few hours, but the information I got was more aimed at people trying to learn x86 assembly, and wasn't detailed enough
Maybe you can help me?
Upvotes: 0
Views: 1678
Reputation: 22989
The art of assembly language, by Randall Hyde. It has a couple of sections on how the processor works, for example:
Chapter Three: System Organization
Upvotes: 0
Reputation: 171
sandpile.org is a nice place if you need information about the encoding format of x86 opcodes. All the info is organized in tables for easy look-up.
Upvotes: 2
Reputation: 6606
You could look at the Intel architecture manuals: http://www.intel.com/products/processor/manuals/ (note: Otavio's link is better as it goes to an older manual)
Of course, these include specifications for a lot of instructions and features that didn't exist in the 8086, but you should be able to skip over the new stuff.
You may also want to look at Bochs to check things or get some ideas.
Finally, unless you're already quite confident, I would recommend starting with a simpler (RISC) instruction set, such as one of the MIPS architectures. Instruction decoding and addressing modes are considerably less complex in a typical RISC architecture than they are in a typical CISC architecture.
Upvotes: 0
Reputation: 74290
You may want to go straight to the source:
http://download.intel.com/design/intarch/manuals/24319101.pdf
Upvotes: 5