Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuff to look into #9

Open
barotto opened this issue Apr 8, 2019 · 2 comments
Open

Stuff to look into #9

barotto opened this issue Apr 8, 2019 · 2 comments
Labels

Comments

@barotto
Copy link
Owner

barotto commented Apr 8, 2019

From #5 (@superfury)

I notice something, looking through the arithmetic(EE) tests: you're not testing all memory-related cases of the tested opcodes.
Opcodes 00-3F only seems to test for memory as the destination(being read and written to), not the source(only being read from, destination being the register of the modr/m(opcodes ending in the 0 and 1 nibbles)).
Opcodes 80-83 don't test the memory cases at all.
The same for opcodes F6 and F7, as well as FE&FF INC/DEC(but for register operands).
0FAF isn't tested for memory operands.
And F6/F7 (I)DIV don't verify reads from memory operands.

Also C* and D* shift/rotate instructions aren't tested for memory operands.

Edit: Just found and fixed a bug in the PUSH/POP SegReg instructions that caused it to increase/decrease virtual ESP(for protection checks) by 2 instead of 4 while verifying against 16-bit memory accesses. As well as fixing 16-bit SIDT/SGDT to properly fill the final byte with 0x00(386+) or 0xFF(286+).
Edit: The 80386 also seems to have had errors in loading the IDTR/GDTR with LIDT/LGDT when the operand size was 16-bit, causing it to load the highest byte(92h in the MSB of the IDTR/GDTR) incorrectly.

I eventually found some bugs with the BSF and BSR instructions(ZF flag updated incorrectly(for the r/m16/32 value being 1) and the reg value not being written into the register)

@barotto barotto added the TODO label Apr 8, 2019
@superfury
Copy link

superfury commented Apr 12, 2019

I've added those instructions to UniPCemu's testsuite(which requires verification by looking at the log, nothing automated in it). They seem to produce correct results :D

So UniPCemu doesn't seem to have problems with those instructions(didn't test anything like paging and protection etc. through). Also, it just tests the generic subset of those instructions(with reads from memory using mul/div and writes/reads with all others).
https://bitbucket.org/superfury/unipcemu/src/a66465b37988aaef7bcb0a908d8199e400d09794/UniPCemu/assembly/?at=master

@superfury
Copy link

Any ideas on implementing the remainder of tests with protected mode interrupts and tasks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants