projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* device/lib/z80/mul.s (__mulsuchar_rrx_s, __muluschar_rrx_s),
[fw/sdcc]
/
src
/
z80
/
gen.c
diff --git
a/src/z80/gen.c
b/src/z80/gen.c
index 2ef191da5a0f8b66ab8c8db4dd50a3756480d224..226434d2490e25db7265cadf840668edbe339691 100644
(file)
--- a/
src/z80/gen.c
+++ b/
src/z80/gen.c
@@
-4787,13
+4787,16
@@
genCmpGt (iCode * ic, iCode * ifx)
letype = getSpec (operandType (left));
retype = getSpec (operandType (right));
sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype));
letype = getSpec (operandType (left));
retype = getSpec (operandType (right));
sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype));
- /* assign the a
ms
ops */
+ /* assign the a
sm
ops */
aopOp (left, ic, FALSE, FALSE);
aopOp (right, ic, FALSE, FALSE);
aopOp (result, ic, TRUE, FALSE);
aopOp (left, ic, FALSE, FALSE);
aopOp (right, ic, FALSE, FALSE);
aopOp (result, ic, TRUE, FALSE);
+ setupToPreserveCarry (ic);
+
genCmp (right, left, result, ifx, sign);
genCmp (right, left, result, ifx, sign);
+ _G.preserveCarry = FALSE;
freeAsmop (left, NULL, ic);
freeAsmop (right, NULL, ic);
freeAsmop (result, NULL, ic);
freeAsmop (left, NULL, ic);
freeAsmop (right, NULL, ic);
freeAsmop (result, NULL, ic);
@@
-4817,13
+4820,16
@@
genCmpLt (iCode * ic, iCode * ifx)
retype = getSpec (operandType (right));
sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype));
retype = getSpec (operandType (right));
sign = !(SPEC_USIGN (letype) | SPEC_USIGN (retype));
- /* assign the a
ms
ops */
+ /* assign the a
sm
ops */
aopOp (left, ic, FALSE, FALSE);
aopOp (right, ic, FALSE, FALSE);
aopOp (result, ic, TRUE, FALSE);
aopOp (left, ic, FALSE, FALSE);
aopOp (right, ic, FALSE, FALSE);
aopOp (result, ic, TRUE, FALSE);
+ setupToPreserveCarry (ic);
+
genCmp (left, right, result, ifx, sign);
genCmp (left, right, result, ifx, sign);
+ _G.preserveCarry = FALSE;
freeAsmop (left, NULL, ic);
freeAsmop (right, NULL, ic);
freeAsmop (result, NULL, ic);
freeAsmop (left, NULL, ic);
freeAsmop (right, NULL, ic);
freeAsmop (result, NULL, ic);
@@
-7493,8
+7499,7
@@
genCast (iCode * ic)
else
{
/* we need to extend the sign :{ */
else
{
/* we need to extend the sign :{ */
- const char *l = aopGet (AOP (right), AOP_SIZE (right) - 1,
- FALSE);
+ const char *l = aopGet (AOP (right), AOP_SIZE (right) - 1, FALSE);
_moveA (l);
emit2 ("rla ");
emit2 ("sbc a,a");
_moveA (l);
emit2 ("rla ");
emit2 ("sbc a,a");