#define D(x) x
+#define TR_DPTR(s) if (options.model != MODEL_FLAT24) { emitcode(";", " Use_DPTR1 %s ", s); }
+#define TR_AP(s) if (options.model != MODEL_FLAT24) { emitcode(";", " Use_AP %s ", s); }
+
unsigned fReturnSizeDS390 = 5; /* shared with ralloc.c */
static char *fReturn24[] =
{"dpl", "dph", "dpx", "b", "a"};
}
else
{
+ TR_DPTR("#1");
emitcode ("mov", "dps, #0x01");
}
}
{
if (options.model == MODEL_FLAT24)
emitcode ("mov", "dpx1,#0x40");
+ TR_DPTR("#2");
emitcode ("mov", "dph1,#0x00");
emitcode ("mov", "dpl1, a");
}
genSetDPTR (1);
if (!canClobberACC)
{
+ TR_AP("#1");
emitcode ("xch", "a, %s", DP2_RESULT_REG);
}
}
genSetDPTR (0);
if (!canClobberACC)
{
+ TR_AP("#2");
emitcode ("xch", "a, %s", DP2_RESULT_REG);
return DP2_RESULT_REG;
}
* above branch.
*/
assert(AOP_NEEDSACC(IC_RIGHT(ic)));
+ TR_AP("#3");
D(emitcode(";", "+ AOP_ACC special case."););
emitcode("xch", "a, %s", DP2_RESULT_REG);
}
{
if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC)
{
+ TR_AP("#4");
emitcode("add", "a, %s", DP2_RESULT_REG);
}
else
int size, resultSize, compSize;
int offset = 0;
+ TR_AP("#5");
D(emitcode(";", "%s special case for 3 far operands.", logicOp););
compSize = AOP_SIZE(IC_LEFT(ic)) < AOP_SIZE(IC_RIGHT(ic)) ?
AOP_SIZE(IC_LEFT(ic)) : AOP_SIZE(IC_RIGHT(ic));
leftByte = aopGet (AOP(left), offl, FALSE, FALSE, TRUE);
if (strcmp(leftByte, DP2_RESULT_REG))
{
+ TR_AP("#7");
emitcode("mov","%s,%s", DP2_RESULT_REG, leftByte);
}
// And MSB in A.
}
emitcode("mov", "dps, #0");
freeAsmop (right, NULL, ic, FALSE);
+#if 0
+some alternative code for processors without auto-toggle
+no time to test now, so later well put in...kpb
+ D(emitcode(";","genFarFarAssign (dual-dptr fun)"););
+ emitcode("mov", "dps, #0x01"); /* Select DPTR2. */
+ emitcode ("mov", "dptr,#%s", rSym->rname);
+ /* DP2 = result, DP1 = right, DP1 is current. */
+ while (size)
+ {
+ --size;
+ emitcode("movx", "a,@dptr");
+ if (size)
+ emitcode("inc", "dptr");
+ emitcode("inc", "dps");
+ emitcode("movx", "@dptr,a");
+ if (size)
+ emitcode("inc", "dptr");
+ emitcode("inc", "dps");
+ }
+ emitcode("mov", "dps, #0");
+ freeAsmop (right, NULL, ic, FALSE);
+#endif
}
else
{