First post, by phix

User metadata
Rank Newbie


I'm currently working on a small PC/XT emulator as a learning experience and so far things has progressed quite nicely. 😀
Currently I'm at a state where I handle all 8086 instruction (with only one or two exceptions) and I'm using a modified version of Adrian Cable's BIOS for his 8086tiny project.
I have *some* emulation in place for the PC hardware like PIC, PIT and video that allows me to actually run not only the BIOS code but also some smaller applications (some boot-sector games kind of works).

So the current problem I have right now (which leads me to the question here) is that I have bugs in my instruction interpretation. I have not yet been able to boot a real OS for example.
This is of course not always that easy to track down so I have been thinking of ways to help with debug that.

1.) The obvious thing would be to use application level unit tests. (preferably I should have done that from day one, but I have not)

2.) The other thing I did try was to do "locksteping" with a known working emulator. That helped me track down a few things but it got very complicated in the end.

3.) The other thing i ran across was this: https://github.com/spycrab/8086-accuracy. This program is no where near complete (and has a few problems of its own) but it got me thinking that there might be others like it!

So my QUESTION is:

Are there any CPU verification program that run on a 8086/88 CPU? I imagine it would be very helpful in emulator development if it did.
Especially when you are relatively new to the subject like I am. 😀

Any help or tips is greatly appreciated!

Reply 1 of 3, by superfury

User metadata
Rank l33t

If you can upgrade to 80186 CPU emulation(a handful of new instructions) you can run the 80186 testsuite (I mentioned it here: Re: Test suite and/or how to find bugs in x86 VM).
You can alternatively take Hottobar's 80386 testsuite(https://github.com/barotto/test386.asm) and rip out all 80186+ instructions.

Finally, UniPCemu supports importing instruction output in the common emulator format for verification(It'll dump information when a mismatch occurs). You'll just have to redirect the output from your emulator to UniPCemu's input(using simple piping) and have UniPCemu start it's verification using the "debuggerin"(unquoted) command line parameter(debuggerout does the opposite, dumping it's own debugger output to stdout instead of reading from stdin). Said read data(line endings automatically converted) from stdin is compared with it's own. If a mismatch occurs, "<VERIFY:MISMATCH>"(without quotes) is logged after any mismatching line not matching UniPCemu's logging.

Of course, it requires that the logging is enabled in it's settings.
Edit: Just added documentation on the command-line parameters to the manual.

UniPCemu Git repository
UniPCemu for Android, Windows and PSP on itch.io
Older UniPCemu PC/Android/PSP releases