git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1437
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+#if 0 // AOP_OP_3 is deprecated; nobody likes Ack errors.
+ // Please don't bring it back without a really good reason.
// Macro to aopOp all three operands of an ic. Will fatal if this cannot be done
// (because all three operands are in far space).
#define AOP_OP_3(ic) \
// Macro to aopOp all three operands of an ic. Will fatal if this cannot be done
// (because all three operands are in far space).
#define AOP_OP_3(ic) \
fprintf(stderr, \
"Ack: three operands in far space! (%s:%d %s:%d)\n", __FILE__, __LINE__, ic->filename, ic->lineno); \
}
fprintf(stderr, \
"Ack: three operands in far space! (%s:%d %s:%d)\n", __FILE__, __LINE__, ic->filename, ic->lineno); \
}
// Macro to aopOp all three operands of an ic. If this cannot be done,
// the IC_LEFT and IC_RIGHT operands will be aopOp'd, and the rc parameter
// Macro to aopOp all three operands of an ic. If this cannot be done,
// the IC_LEFT and IC_RIGHT operands will be aopOp'd, and the rc parameter
static void
genModbits (operand * left,
operand * right,
static void
genModbits (operand * left,
operand * right,
+ operand * result,
+ iCode * ic)
emitcode ("div", "ab");
emitcode ("mov", "a,b");
emitcode ("rrc", "a");
emitcode ("div", "ab");
emitcode ("mov", "a,b");
emitcode ("rrc", "a");
+ aopOp(result, ic, TRUE, FALSE);
aopPut (AOP (result), "c", 0);
}
aopPut (AOP (result), "c", 0);
}
static void
genModOneByte (operand * left,
operand * right,
static void
genModOneByte (operand * left,
operand * right,
+ operand * result,
+ iCode * ic)
{
sym_link *opetype = operandType (result);
char *l;
{
sym_link *opetype = operandType (result);
char *l;
/* unsigned is easy */
LOAD_AB_FOR_DIV (left, right, l);
emitcode ("div", "ab");
/* unsigned is easy */
LOAD_AB_FOR_DIV (left, right, l);
emitcode ("div", "ab");
+ aopOp(result, ic, TRUE, FALSE);
aopPut (AOP (result), "b", 0);
return;
}
aopPut (AOP (result), "b", 0);
return;
}
emitcode ("", "%05d$:", (lbl->key + 100));
/* now we are done */
emitcode ("", "%05d$:", (lbl->key + 100));
/* now we are done */
+ aopOp(result, ic, TRUE, FALSE);
aopPut (AOP (result), "b", 0);
}
aopPut (AOP (result), "b", 0);
}
operand *right = IC_RIGHT (ic);
operand *result = IC_RESULT (ic);
operand *right = IC_RIGHT (ic);
operand *result = IC_RESULT (ic);
- D (emitcode (";", "genMod ");
- );
+ D (emitcode (";", "genMod "); );
/* special cases first */
/* both are bits */
if (AOP_TYPE (left) == AOP_CRY &&
AOP_TYPE (right) == AOP_CRY)
{
/* special cases first */
/* both are bits */
if (AOP_TYPE (left) == AOP_CRY &&
AOP_TYPE (right) == AOP_CRY)
{
- genModbits (left, right, result);
+ genModbits (left, right, result, ic);
if (AOP_SIZE (left) == 1 &&
AOP_SIZE (right) == 1)
{
if (AOP_SIZE (left) == 1 &&
AOP_SIZE (right) == 1)
{
- genModOneByte (left, right, result);
+ genModOneByte (left, right, result, ic);