OpenCores
Issue List
INI operation does not set Zero flag #1
Closed bsa opened this issue about 12 years ago
bsa commented about 12 years ago

I try run code: ld bc,00130h ini after this operation BC=00030h, AF=00002h. Zero flag is not set!!! I check it in the simulator. As I see, in ZEXDOC/ZEXALL tests for ini/inir and outi/otir are not present. So it is possible that all of them are buggy.

ndumitrache commented about 12 years ago

I just tested your code (on the FPGA implemenated test machine provided in the NextZ80 package), and the flags are correctly set. After the INI instruction the F register contains 42h. Indeed the ZEXDOC do not test the in/out instructions, but I manually checked them all and they seem correct. I mention I am using XILINX ISE (v13.4) and a Spartan3AN board.

bsa commented about 12 years ago

Very strange. I test using Altera Cyclone 3 and ZF does not set.

<p>Can you try other code:</p> <pre> ld bc,0030h inc b ini</pre>
bsa commented about 12 years ago

I retest and found, that INI does not change ZF. If ZF before INI were 1 then after it also contains 1, same with 0.

ndumitrache commented about 12 years ago

Yes, there is a problem. If ZF is 0 before INI, it will be 0 after INI. If ZF is 1 before INI, it will be correctly set after INI. I will provide a fix for this issue. Thank you for your help.

ndumitrache commented about 12 years ago

Yes, there is a problem. If ZF is 0 before INI, it will be 0 after INI. If ZF is 1 before INI, it will be correctly set after INI. I will provide a fix for this issue. Thank you for your help.

ndumitrache commented about 12 years ago

The bug is fixed on SVN.

ndumitrache closed this about 12 years ago

Assignee
No one
Labels
Bug