From 4055176e860f350608937848b3cb922349f5cb38 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 3 Jan 2014 02:36:17 -0500 Subject: [PATCH] Fix error with ADDC instruction The carry flag was not added to the result. --- src/common/opcode2c.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/opcode2c.pl b/src/common/opcode2c.pl index 8b90af8..c8d6bb5 100755 --- a/src/common/opcode2c.pl +++ b/src/common/opcode2c.pl @@ -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 -- 2.20.1