sym = OP_SYMBOL (op);
-
/* if the type is a conditional */
if (sym->regType == REG_CND)
{
if (sym->ruonly)
{
unsigned i;
+
aop = op->aop = sym->aop = newAsmop (AOP_STR);
aop->size = getSize (sym->type);
for (i = 0; i < fReturnSizeMCS51; i++)
}
{
symbol *lbl = newiTempLabel (NULL);
- emitcode ("clr", "c; oops");
+ emitcode ("clr", "c");
emitcode ("jz", "%05d$", lbl->key + 100);
emitcode ("cpl", "c");
emitcode ("", "%05d$:", lbl->key + 100);
sic = setNextItem (_G.sendSet))
{
int size, offset = 0;
- aopOp (IC_LEFT (sic), sic, FALSE);
- size = AOP_SIZE (IC_LEFT (sic));
- while (size--)
- {
- char *l = aopGet (AOP (IC_LEFT (sic)), offset,
- FALSE, FALSE);
- if (strcmp (l, fReturn[offset]))
- emitcode ("mov", "%s,%s",
- fReturn[offset],
- l);
- offset++;
+ if (IS_VALOP(IC_LEFT(sic)) && IS_OP_LITERAL(IC_LEFT(sic))
+ // PENDING: checkConstant2Type()
+ // do some range checking here, just bitvars for now
+ && IS_BITVAR(IC_LEFT(sic)->operand.valOperand->type)) {
+ if (floatFromVal(IC_LEFT(sic)->operand.valOperand)) {
+ emitcode ("mov", "%s,#0x01", fReturn[0]);
+ } else {
+ emitcode ("mov", "%s,#0x00", fReturn[0]);
}
- freeAsmop (IC_LEFT (sic), NULL, sic, TRUE);
+ } else {
+ aopOp (IC_LEFT (sic), sic, FALSE);
+ size = AOP_SIZE (IC_LEFT (sic));
+ while (size--)
+ {
+ char *l = aopGet (AOP (IC_LEFT (sic)), offset,
+ FALSE, FALSE);
+ if (strcmp (l, fReturn[offset]))
+ emitcode ("mov", "%s,%s",
+ fReturn[offset],
+ l);
+ offset++;
+ }
+ freeAsmop (IC_LEFT (sic), NULL, sic, TRUE);
+ }
}
_G.sendSet = NULL;
}
aopOp (result, ic, FALSE);
/* if the result is a bit */
- if (AOP_TYPE (result) == AOP_CRY)
+ // if (AOP_TYPE (result) == AOP_CRY /* works only for true symbols */
+ if (IS_BITVAR(OP_SYMBOL(result)->type))
{
/* if the right size is a literal then
we know what the value is */