OpenCores

Lightweight 8080 compatible core

Issue List
bug in INR M #1
Closed ja_rd opened this issue over 15 years ago
ja_rd commented over 15 years ago

Some instances of INR M worked while others did not.

Microcode flag #setacy was missing in the microcode source for INR M (line 370 of light8080.m80) and the auxiliary carry flag used in all increments (including PC) was not being set and kept its previous value. It passed the test bench by chance, apparently.

The code in the CVS has the bug fixed.

ja_rd commented over 15 years ago

Ok, solved. The bug triggered more or less randomly, and not on a fixed code. It happend because INR uses an auxiliary carry flag that has to be set by the microcode in order to do the increment in the ALU. If the microcode does not set the flag (which is what was happening), it would hold the value from the execution of the previous instruction, so INR would sometimes work and sometimes not. The code as it stands works, but the machine should be modified so the internal flags llike this are reset between instructions, this should have made the bug very easy to catch.

ja_rd closed this over 15 years ago
ja_rd commented over 15 years ago

Note: the auxiliary carry flag does in fact reset between instructions, but it is updated when incrementing the PC.


Assignee
No one
Labels
Bug