From 30d141860aa3cfe1969eecf939dce97e04979167 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 3 Jan 2014 02:37:18 -0500 Subject: [PATCH] Fix code indentation --- src/common/opcode2c.pl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/common/opcode2c.pl b/src/common/opcode2c.pl index c8d6bb5..df8b04e 100755 --- a/src/common/opcode2c.pl +++ b/src/common/opcode2c.pl @@ -460,8 +460,10 @@ for ($i=0 ; $i< 256; $i++) { cfw(" if (((destination & 0x7F) + (source & 0x7F)) < 0x80)"); cfw(" psw_set_ov();"); # If no carry from bit 7, but caary from bit 6, set OV - cfw("} else if (((destination & 0x7F) + (source & 0x7F)) > 0x7F ) psw_set_ov();"); - cfw("if (((destination & 0x0F) + (source & 0x0F)) > 0x0F) psw_set_ac();"); + cfw("} else if (((destination & 0x7F) + (source & 0x7F)) > 0x7F )"); + cfw(" psw_set_ov();"); + cfw("if (((destination & 0x0F) + (source & 0x0F)) > 0x0F)"); + cfw(" psw_set_ac();"); cfw("destination += source;"); } @@ -484,6 +486,9 @@ for ($i=0 ; $i< 256; $i++) { } # ADDC + # ADD and ADDC function identically except that ADDC adds the value of + # operand as well as the value of the Carry flag whereas ADD does not + # add the Carry flag to the result. if ($insttype[$i] == 17) { cfw("unsigned char carryflag = psw_read_cy();"); cfw("psw_clr_cy();"); @@ -493,8 +498,10 @@ for ($i=0 ; $i< 256; $i++) { cfw(" psw_set_cy();"); cfw(" if (((destination & 0x7F) + (source & 0x7F) + carryflag) < 0x80)"); 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("} else if (((destination & 0x7F) + (source & 0x7F) + carryflag) > 0x7F)"); + cfw(" psw_set_ov();"); + cfw("if (((destination & 0x0F) + (source & 0x0F) + carryflag) > 0x0F)"); + cfw(" psw_set_ac();"); cfw("destination += source + carryflag;"); } -- 2.20.1