projects
/
emu8051.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4055176
)
Fix code indentation
author
Hugo Villeneuve
<hugo@hugovil.com>
Fri, 3 Jan 2014 07:37:18 +0000
(
02:37
-0500)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Fri, 3 Jan 2014 07:37:18 +0000
(
02:37
-0500)
src/common/opcode2c.pl
patch
|
blob
|
history
diff --git
a/src/common/opcode2c.pl
b/src/common/opcode2c.pl
index
c8d6bb5
..
df8b04e
100755
(executable)
--- 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(" 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;");
}
cfw("destination += source;");
}
@@
-484,6
+486,9
@@
for ($i=0 ; $i< 256; $i++) {
}
# ADDC
}
# 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();");
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(" 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;");
}
cfw("destination += source + carryflag;");
}