VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I do know that modr/m has certain cycle counts which are added to instruction cycle counts(EA calculation) and that REP instructions take shorter than normal.

I don't know the exact cycle counts for every instruction(all opcode base instruction variants and GRP1-5 opcodes. Anyone knows a complete list?

What's the best way to implement this in my emulator(look at opcodes_8086.c and modrm.c)?

Also, are there differences in cycle counts between 8086 and 8088?

I also see some opcodes with variable cycle counts(like MUL). What about those?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 4, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

This is what I use for my emulator:

http://ece425web.groups.et.byu.net/stable/lab … tructionSet.pdf

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 2 of 4, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

I also used a much more concise document from here, but that link seems to have disappear. I tried searching for the PDF name but came out empty.

http://www.eecs.wsu.edu/~aofallon/ee234/hando … ts/x86times.pdf

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 3 of 4, by Scali

User metadata
Rank l33t
Rank
l33t
superfury wrote:

I don't know the exact cycle counts for every instruction(all opcode base instruction variants and GRP1-5 opcodes. Anyone knows a complete list?

Nobody does. Reenigne has designed a piece of hardware to measure the bus activity in a system, so pieces of code can be analysed, and exact cycle counts can be derived.

superfury wrote:

Also, are there differences in cycle counts between 8086 and 8088?

Yes. The cycle counts that Intel lists are 'best-case', and assume all code is running from the prefetch buffer. They are pretty much useless for an emulator, since these figures are not realistic.
Firstly, the prefetch buffer on 8086 is 2 bytes larger than on 8088, so it will run code from the prefetch buffer more often.
Secondly, the 8086 has a 16-bit bus, so that means it can prefetch more during idle bus cycles.
Obviously any memory operation involving 16-bit access will also be broken into two 8-bit accesses on the 8088, taking more time as well.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 4 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've found this list:
http://zsmith.co/intel.html

Is that list any good? Also I notice timing with a "/" in the 8086 columns. Anyone knows what this means? What do those two slash-seperated values stand for? (Like retn)

Btw the location of my CPU emulation (current version): https://bitbucket.org/superfury/x86emu/src/40 … /cpu/?at=master

Edit: Are those numbers simply 8088 timing / 8086 timing?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io