Need help finding error in 8086 emulator

Jun 16, 2014 at 7:04am
Can someone help me finding the error(s) in my x86 emulator? I've based the CPU opcodes on fake85, with my own adjustments for my written CPU/MMU system.

Folder with the source code of my 8086 emulation (excluding modr/m and CPU main functions, so just the opcodes and handlers into the emulator):
https://drive.google.com/folderview?id=0B6QVh3ktO0cxTFQzSnp6Nm0yTlE&usp=sharing
Jun 16, 2014 at 7:22am
testing x86 instruction set by hand seems is high effort task. Create testing tools with vectored arguments, since you already have target device (pc or emu) and compare core registers/memory after each instruction to find bugs.
Jun 16, 2014 at 7:28am
I've found a 80186 test toolkit once (used for fake86 originally). But it didn't contain any information on in what order to test the instructions (which are based upon the results of other tests, like a test testing bitflags operations (and, or, xor, not etc.) is dependent on the jump operations (jmp, jz/je, jnz/jne, jo, jno etc.) Anyone has a list of the order to test the opcodes in?
Jun 16, 2014 at 7:41am
the same operations should be executed on emu and target:
1. load core register values (some vectored values)
2. execute instruction
3. store register values (for example, to a file). On target you can store context on stack and then read it from memory location, in emu its a matter of copying data.

4. do this all again for different basic values (min, max, and some random values).

after than, compare txt files for differences.

This is for only 1 instruction. Branching and memory access instruction would need a little modified tests.
Jun 16, 2014 at 11:02am
I simply need to know in what order to test the instructions. I use the testsuite from fake86 (located in 80186_tests.zip). Afaik a HLT/HALT instruction terminates the program, after which it can be verified against res_<test name,e.g. add>.bin

Anyone knows in what order to process the *.bin executable files? So like:
add.bin,
(...),
interrupt.bin etc.
Last edited on Jun 16, 2014 at 11:39am
Topic archived. No new replies allowed.