Fix error with ADDC instruction
authorHugo Villeneuve <hugo@hugovil.com>
Fri, 3 Jan 2014 07:36:17 +0000 (02:36 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Fri, 3 Jan 2014 07:36:17 +0000 (02:36 -0500)
The carry flag was not added to the result.

src/common/opcode2c.pl

index 8b90af8..c8d6bb5 100755 (executable)
@@ -495,7 +495,7 @@ for ($i=0 ; $i< 256; $i++) {
            cfw("       psw_set_ov();");
            cfw("} else if (((destination & 0x7F) + (source & 0x7F) + carryflag) > 0x7F)  psw_set_ov();");
            cfw("if (((destination & 0x0F) + (source & 0x0F) + carryflag) > 0x0F)  psw_set_ac();");
-           cfw("destination += source;");
+           cfw("destination += source + carryflag;");
        }
 
        # JC