Page 1 of 1

Fixed Some Issues Related With Overflow Flag

Posted: Thu Nov 03, 2022 10:26 am
by spark2k06

One of the issues that were opened involved incorrect operation of some instructions in very specific cases, the CPU LandMark System Speed 6.0 test:

https://github.com/MiSTer-devel/PCXT_MiSTer/issues/26

Well, after several days of debugging, and with the help of @MicroCoreLabs, I have managed to get it working:

LM60.png
LM60.png (226.64 KiB) Viewed 1105 times

The problem was due to the fact that in certain scenarios, the CMP instruction did not set the overflow flag correctly. Actually, it was related to the SUB instruction.

MicroCoreLabs had already detected this problem with the ADC/SBB instructions... and had a solution for it:

https://github.com/MiSTer-devel/PCXT_Mi ... e8437fe186

to which I have added the ADD/SUB solution:

https://github.com/MiSTer-devel/PCXT_Mi ... 5c7302f7c1

I attach a corresponding binary for testing purposes, before sending a general update to everyone.

It may also be that this fix will solve other problems. Any feedback is welcome.