nsauzede / cpu86

🔌 CPU86 - Free VHDL CPU8088 IP core - ported to Papilio and Max1000 FPGA
https://github.com/nsauzede/cpu86/wiki
GNU General Public License v2.0
37 stars 10 forks source link

ALU_INC probably should not modify Carry Flag #2

Open ecm-pushbx opened 2 years ago

ecm-pushbx commented 2 years ago

https://github.com/nsauzede/cpu86/blob/2f77646c7964f2da55c872cdfd33ec94ad82dd01/cpu86_rtl/alu_rtl.vhd#L714

Here and in the following lines we have a separate entry for ALU_DEC noting that it doesn't modify the Carry Flag. ALU_INC is grouped with the ALU_ADD operations though. Perhaps this means inc instructions modify Carry when they shouldn't.

nsauzede commented 2 years ago

interesting !

Note that I'm not the author of this design, only a user of it in the past.. And indeed I had noticed some CF issues when trying to run some legacy code Perhaps you pinpointed the rootcause(s) of it..

I should really set up a serious usecase showing the issue I had, and try and debug it with your suggestion

Unfortunately, I lack the free time for that... :-(