+2004-12-03 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+ * src/z80/gen.c (genLeftShift, genRightShift): fixed second part of
+ bug #1074377
+ * src/hc08/gen.c (genrshFour, shiftRLong, shiftLLong),
+ * src/mcs51/gen.c (shiftLLong): Fixed some shifting bugs Frieder found
+
2004-12-02 Slade Rich <slade_rich AT users.sourceforge.net>
* src/pic/pcode.c : fixed a problem where banksel was not being inserted.
loadRegFromAop (hc08_reg_a, AOP (left), MSB24);
rmwWithReg ("rol", hc08_reg_a);
storeRegToAop (hc08_reg_a, AOP (result), offr+2);
+ storeConstToAop (zero, AOP (result), 0);
}
pullOrFreeReg (hc08_reg_x, needpulx);
else
rmwWithReg ("lsr", hc08_reg_a);
storeRegToAop (hc08_reg_a, AOP (result), MSB24);
+ storeRegSignToUpperAop (hc08_reg_a, AOP (result), MSB32, sign);
}
loadRegFromAop (hc08_reg_xa, AOP (left), offl);
loadRegFromConst (hc08_reg_a, zero);
XAccRsh (shCount-8, sign);
accopWithAop ("ora", AOP (result), 1);
- storeRegToFullAop (hc08_reg_xa, AOP (result), 1);
+ storeRegToAop (hc08_reg_xa, AOP (result), 1);
+ storeRegSignToUpperAop (hc08_reg_x, AOP(result), 3, sign);
}
}
else
if (size >= MSB24 + offr)
{
- if (!(sameRegs (AOP (left), AOP (left)) && size >= MSB24 + offr && offr != LSB))
+ if (!(sameRegs (AOP (result), AOP (left)) && size >= MSB24 + offr && offr != LSB))
{
l = aopGet (AOP (left), MSB24, FALSE, FALSE);
MOVA (l);
aopOp (left, ic, FALSE, FALSE);
aopOp (result, ic, FALSE, FALSE);
+ if (AOP_TYPE (left) != AOP_REG || AOP_TYPE (result) != AOP_REG)
+ _push (PAIR_AF);
+
/* now move the left to the result if they are not the
same */
offset = 0;
tlbl1 = newiTempLabel (NULL);
+ if (AOP_TYPE (left) != AOP_REG || AOP_TYPE (result) != AOP_REG)
+ _pop (PAIR_AF);
+
emit2 ("!shortjp !tlabel", tlbl1->key + 100);
emitLabel (tlbl->key + 100);
l = aopGet (AOP (result), offset, FALSE);
aopOp (left, ic, FALSE, FALSE);
aopOp (result, ic, FALSE, FALSE);
+ if (AOP_TYPE (left) != AOP_REG || AOP_TYPE (result) != AOP_REG)
+ _push (PAIR_AF);
+
/* now move the left to the result if they are not the
same */
if (!sameRegs (AOP (left), AOP (result)))
tlbl1 = newiTempLabel (NULL);
size = AOP_SIZE (result);
offset = size - 1;
+
+ if (AOP_TYPE (left) != AOP_REG || AOP_TYPE (result) != AOP_REG)
+ _pop (PAIR_AF);
emit2 ("!shortjp !tlabel", tlbl1->key + 100);
emitLabel (tlbl->key + 100);