From: Hugo Villeneuve Date: Fri, 3 Jan 2014 07:36:17 +0000 (-0500) Subject: Fix error with ADDC instruction X-Git-Tag: v2.0.0~18 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=4055176e860f350608937848b3cb922349f5cb38;p=emu8051.git Fix error with ADDC instruction The carry flag was not added to the result. --- 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