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.
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.
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?
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.
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.