} \
free(_mova_tmp); \
}
+#define MOVB(x) { char *_movb_tmp = strdup(x); \
+ if (strcmp(_movb_tmp,"b")) \
+ { \
+ emitcode("mov","b,%s",_movb_tmp); \
+ } \
+ free(_movb_tmp); \
+ }
#define CLRC emitcode("clr","c")
#define SETC emitcode("setb","c")
static regs *
getFreePtr (iCode * ic, asmop ** aopp, bool result)
{
- bool r0iu = FALSE, r1iu = FALSE;
- bool r0ou = FALSE, r1ou = FALSE;
+ bool r0iu, r1iu;
+ bool r0ou, r1ou;
/* the logic: if r0 & r1 used in the instruction
then we are in trouble otherwise */
werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
"getFreePtr should never reach here");
exit (1);
+
+ return NULL; // notreached, but makes compiler happy.
}
/*-----------------------------------------------------------------*/
}
}
-/*------------------------------------------------------------------*/
-/* aopGet - for fetching value of the aop */
-/* */
-/* Set canClobberACC if you are sure it is OK to clobber the value */
-/* in the accumulator. Set it FALSE otherwise; FALSE is always safe, */
-/* just less efficient. */
-/*------------------------------------------------------------------*/
+/*-------------------------------------------------------------------*/
+/* aopGet - for fetching value of the aop */
+/* */
+/* Set saveAcc to NULL if you are sure it is OK to clobber the value */
+/* in the accumulator. Set it to the name of a free register */
+/* if acc must be preserved; the register will be used to preserve */
+/* acc temporarily and to return the result byte. */
+/*-------------------------------------------------------------------*/
static char *
-aopGet (asmop * aop,
- int offset,
- bool bit16,
- bool dname,
- bool canClobberACC)
+aopGet (asmop *aop,
+ int offset,
+ bool bit16,
+ bool dname,
+ char *saveAcc)
{
/* offset is greater than
size then zero */
if (aop->type == AOP_DPTR2)
{
genSetDPTR (1);
- if (!canClobberACC)
+ if (saveAcc)
{
TR_AP("#1");
- emitcode ("xch", "a, %s", DP2_RESULT_REG);
+ emitcode ("xch", "a, %s", saveAcc);
}
}
if (aop->type == AOP_DPTR2)
{
genSetDPTR (0);
- if (!canClobberACC)
+ if (saveAcc)
{
TR_AP("#2");
- emitcode ("xch", "a, %s", DP2_RESULT_REG);
- return DP2_RESULT_REG;
+ emitcode ("xch", "a, %s", saveAcc);
+ return saveAcc;
}
}
return (dname ? "acc" : "a");
werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
"aopget got unsupported aop->type");
exit (1);
+
+ return NULL; // not reached, but makes compiler happy.
}
/*-----------------------------------------------------------------*/
/* aopPut - puts a string for a aop */
* thus avoiding touching A right before the div. \
*/ \
D(emitcode(";", "DS80C390 div bug: rearranged ops.");); \
- L = aopGet(AOP(LEFT),0,FALSE,FALSE,TRUE); \
+ L = aopGet(AOP(LEFT),0,FALSE,FALSE,NULL); \
MOVA(L); \
- emitcode("mov","b,%s",aopGet(AOP(RIGHT),0,FALSE,FALSE,FALSE));\
+ L = aopGet(AOP(RIGHT),0,FALSE,FALSE,"b"); \
+ MOVB(L); \
} \
else \
{ \
/* Just stuff in a nop after loading A. */ \
- emitcode("mov","b,%s",aopGet(AOP(RIGHT),0,FALSE,FALSE,FALSE));\
- L = aopGet(AOP(LEFT),0,FALSE,FALSE,TRUE); \
+ emitcode("mov","b,%s",aopGet(AOP(RIGHT),0,FALSE,FALSE,NULL));\
+ L = aopGet(AOP(LEFT),0,FALSE,FALSE,NULL); \
MOVA(L); \
emitcode("nop", "; workaround for DS80C390 div bug."); \
}
char *l;
symbol *tlbl;
- D (emitcode (";", "genNotFloat ");
- );
+ D (emitcode (";", "genNotFloat "););
/* we will put 127 in the first byte of
the result */
offset = 1;
_startLazyDPSEvaluation ();
- l = aopGet (op->aop, offset++, FALSE, FALSE, TRUE);
+ l = aopGet (op->aop, offset++, FALSE, FALSE, NULL);
MOVA (l);
while (size--)
{
emitcode ("orl", "a,%s",
aopGet (op->aop,
- offset++, FALSE, FALSE, FALSE));
+ offset++, FALSE, FALSE,
+ DP2_RESULT_REG));
}
_endLazyDPSEvaluation ();
{
usedB = TRUE;
emitcode ("push", "b");
- emitcode ("mov", "b, %s", aopGet (AOP (oper), 0, FALSE, FALSE, FALSE));
+ MOVB (aopGet (AOP (oper), 0, FALSE, FALSE, "b"));
}
else
{
- MOVA (aopGet (AOP (oper), 0, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (oper), 0, FALSE, FALSE, NULL));
}
+
while (size--)
{
if (usedB)
{
- emitcode ("orl", "b,%s", aopGet (AOP (oper), offset++, FALSE, FALSE, FALSE));
+ emitcode ("orl", "b,%s",
+ aopGet (AOP (oper), offset++, FALSE, FALSE, NULL));
}
else
{
- emitcode ("orl", "a,%s", aopGet (AOP (oper), offset++, FALSE, FALSE, FALSE));
+ emitcode ("orl", "a,%s",
+ aopGet (AOP (oper), offset++, FALSE, FALSE, DP2_RESULT_REG));
}
}
_endLazyDPSEvaluation ();
symbol *tlbl;
sym_link *optype = operandType (IC_LEFT (ic));
- D (emitcode (";", "genNot ");
- );
+ D (emitcode (";", "genNot "););
/* assign asmOps to operand & result */
aopOp (IC_LEFT (ic), ic, FALSE, FALSE);
- aopOp (IC_RESULT (ic), ic, TRUE, AOP_TYPE (IC_LEFT (ic)) == AOP_DPTR);
+ aopOp (IC_RESULT (ic), ic, TRUE, AOP_USESDPTR(IC_LEFT (ic)));
/* if in bit space then a special case */
if (AOP_TYPE (IC_LEFT (ic)) == AOP_CRY)
int size;
symbol *tlbl;
- D (emitcode (";", "genCpl ");
- );
+ D (emitcode (";", "genCpl "););
/* assign asmOps to operand & result */
aopOp (IC_LEFT (ic), ic, FALSE, FALSE);
- aopOp (IC_RESULT (ic), ic, TRUE, AOP_TYPE (IC_LEFT (ic)) == AOP_DPTR);
+ aopOp (IC_RESULT (ic), ic, TRUE, AOP_USESDPTR(IC_LEFT (ic)));
/* special case if in bit space */
if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY) {
}
tlbl=newiTempLabel(NULL);
emitcode ("cjne", "%s,#0x01,%05d$",
- aopGet(AOP(IC_LEFT(ic)), 0, FALSE,FALSE,TRUE), tlbl->key+100);
+ aopGet(AOP(IC_LEFT(ic)), 0, FALSE,FALSE,NULL), tlbl->key+100);
emitcode ("", "%05d$:", tlbl->key+100);
outBitC (IC_RESULT(ic));
goto release;
_startLazyDPSEvaluation ();
while (size--)
{
- char *l = aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, NULL));
emitcode ("cpl", "a");
aopPut (AOP (IC_RESULT (ic)), "a", offset++);
}
while (size--)
{
aopPut (AOP (result),
- aopGet (AOP (op), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (op), offset, FALSE, FALSE, NULL),
offset);
offset++;
}
- MOVA(aopGet (AOP (op), offset, FALSE, FALSE, TRUE));
+ MOVA(aopGet (AOP (op), offset, FALSE, FALSE, NULL));
emitcode ("cpl", "acc.7");
aopPut (AOP (result), "a", offset);
genUminus (iCode * ic)
{
int offset, size;
- sym_link *optype, *rtype;
-
- D (emitcode (";", "genUminus ");
- );
+ sym_link *optype;
+ D (emitcode (";", "genUminus "););
/* assign asmops */
aopOp (IC_LEFT (ic), ic, FALSE, FALSE);
- aopOp (IC_RESULT (ic), ic, TRUE, AOP_TYPE (IC_LEFT (ic)) == AOP_DPTR);
+ aopOp (IC_RESULT (ic), ic, TRUE, AOP_USESDPTR(IC_LEFT (ic)));
/* if both in bit space then special
case */
}
optype = operandType (IC_LEFT (ic));
- rtype = operandType (IC_RESULT (ic));
/* if float then do float stuff */
if (IS_FLOAT (optype))
_startLazyDPSEvaluation ();
while (size--)
{
- char *l = aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, TRUE);
+ char *l = aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, NULL);
if (!strcmp (l, "a"))
{
if (offset == 0)
/* if any remaining bytes in the result */
/* we just need to propagate the sign */
- if ((size = (AOP_SIZE (IC_RESULT (ic)) - AOP_SIZE (IC_LEFT (ic)))))
+ if ((size = (AOP_SIZE(IC_RESULT(ic)) - AOP_SIZE(IC_LEFT(ic)))) != 0)
{
emitcode ("rlc", "a");
emitcode ("subb", "a,acc");
/* special case if DPTR alive across a function call then must save it
even though callee saves */
if (IFFUNC_CALLEESAVES(OP_SYMBOL (IC_LEFT (ic))->type)) {
- int i =0;
+ int i;
rsave = newBitVect(ic->rMask->size);
for (i = DPL_IDX ; i <= B_IDX ; i++ ) {
if (bitVectBitValue(ic->rMask,i))
bitVect *rsave;
if (IFFUNC_CALLEESAVES(OP_SYMBOL (IC_LEFT (ic))->type)) {
- int i =0;
+ int i;
rsave = newBitVect(ic->rMask->size);
for (i = DPL_IDX ; i <= B_IDX ; i++ ) {
if (bitVectBitValue(ic->rMask,i))
_startLazyDPSEvaluation ();
while (size--)
{
- char *l = aopGet (AOP (oper), offset++, FALSE, TRUE, FALSE);
+ char *l = aopGet (AOP (oper), offset++, FALSE, TRUE, NULL);
if (AOP_TYPE (oper) != AOP_REG &&
AOP_TYPE (oper) != AOP_DIR &&
strcmp (l, "a"))
while (size--)
{
- char *l = aopGet (AOP (IC_LEFT (ic)),
- offset++, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (IC_LEFT (ic)),
+ offset++, FALSE, FALSE, NULL));
emitcode ("movx", "@%s,a", r->name);
emitcode ("inc", "%s", r->name);
}
/*-----------------------------------------------------------------*/
-/* genIpush - genrate code for pushing this gets a little complex */
+/* genIpush - generate code for pushing this gets a little complex */
/*-----------------------------------------------------------------*/
static void
genIpush (iCode * ic)
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (IC_LEFT (ic)), offset++, FALSE, TRUE, TRUE);
+ l = aopGet (AOP (IC_LEFT (ic)), offset++, FALSE, TRUE, NULL);
if (*l == '#')
{
MOVA (l);
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (IC_LEFT (ic)), offset++, FALSE, TRUE, FALSE);
+ l = aopGet (AOP (IC_LEFT (ic)), offset++, FALSE, TRUE, NULL);
if (AOP_TYPE (IC_LEFT (ic)) != AOP_REG &&
AOP_TYPE (IC_LEFT (ic)) != AOP_DIR &&
- strcmp (l, "a"))
+ strcmp (l, "acc"))
{
emitcode ("mov", "a,%s", l);
emitcode ("push", "acc");
}
else
- emitcode ("push", "%s", l);
+ {
+ emitcode ("push", "%s", l);
+ }
}
_endLazyDPSEvaluation ();
while (size--)
{
emitcode ("pop", "%s", aopGet (AOP (IC_LEFT (ic)), offset--,
- FALSE, TRUE, TRUE));
+ FALSE, TRUE, NULL));
}
_endLazyDPSEvaluation ();
}
while (size--) {
char *l = aopGet (AOP (IC_LEFT (sic)), offset,
- FALSE, FALSE, TRUE);
+ FALSE, FALSE, NULL);
if (strcmp (l, fReturn[offset])) {
emitcode ("mov", "%s,%s",
fReturn[offset],
aopOp (IC_LEFT (sic), sic, FALSE, TRUE);
while (size--) {
emitcode ("mov","b1_%d,%s",rb1_count++,aopGet (AOP (IC_LEFT (sic)), offset++,
- FALSE, FALSE, TRUE));
+ FALSE, FALSE, NULL));
}
freeAsmop (IC_LEFT (sic), NULL, sic, TRUE);
}
if (aopHasRegs(AOP(IC_LEFT(ic)),R0_IDX,R1_IDX) ||
aopHasRegs(AOP(IC_LEFT(ic)),R2_IDX,R3_IDX)) {
for (i = 0 ; i < size ; i++ ) {
- emitcode ("push","%s",aopGet(AOP(IC_LEFT(ic)),i,FALSE,TRUE,FALSE));
+ emitcode ("push","%s",
+ aopGet(AOP(IC_LEFT(ic)),i,FALSE,TRUE,DP2_RESULT_REG));
}
for (i = (size-1) ; i >= 0 ; i--) {
emitcode ("pop","a%s",javaRet[i]);
}
} else {
for (i = 0 ; i < size ; i++)
- emitcode ("mov","%s,%s",javaRet[i],aopGet(AOP(IC_LEFT(ic)),i,FALSE,TRUE,FALSE));
+ emitcode ("mov","%s,%s",javaRet[i],
+ aopGet(AOP(IC_LEFT(ic)),i,FALSE,TRUE,DP2_RESULT_REG));
}
for (i = size ; i < 4 ; i++ )
emitcode ("mov","%s,#0",javaRet[i]);
{
int size, offset = 0, pushed = 0;
- D (emitcode (";", "genRet ");
- );
+ D (emitcode (";", "genRet "););
/* if we have no return value then
just generate the "ret" */
if (AOP_TYPE (IC_LEFT (ic)) == AOP_DPTR)
{
l = aopGet (AOP (IC_LEFT (ic)), offset++,
- FALSE, TRUE, FALSE);
+ FALSE, TRUE, NULL);
emitcode ("push", "%s", l);
pushed++;
}
* is is OK to clobber it in the aopGet.
*/
l = aopGet (AOP (IC_LEFT (ic)), offset,
- FALSE, FALSE, TRUE);
+ FALSE, FALSE, NULL);
if (strcmp (fReturn[offset], l))
emitcode ("mov", "%s,%s", fReturn[offset++], l);
}
if (size == 1 && AOP(IC_LEFT(ic)) == AOP(IC_RESULT(ic)) &&
AOP_TYPE(IC_LEFT(ic)) == AOP_DIR ) {
while (icount--) {
- emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE));
+ emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,NULL));
}
return TRUE;
}
(size > 1) &&
(icount == 1))
{
- symbol *tlbl;
- int emitTlbl;
- int labelRange;
+ symbol *tlbl;
+ int emitTlbl;
+ int labelRange;
+ char *l;
/* If the next instruction is a goto and the goto target
* is <= 5 instructions previous to this, we can generate
&& (labelRange = findLabelBackwards (ic, IC_LABEL (ic->next)->key)) != 0
&& labelRange <= 5)
{
- emitcode (";", "tail increment optimized (range %d)", labelRange);
+ D(emitcode (";", "tail increment optimized (range %d)", labelRange););
tlbl = IC_LABEL (ic->next);
emitTlbl = 0;
}
tlbl = newiTempLabel (NULL);
emitTlbl = 1;
}
- emitcode ("inc", "%s", aopGet (AOP (IC_RESULT (ic)), LSB, FALSE, FALSE, FALSE));
+
+ l = aopGet (AOP (IC_RESULT (ic)), LSB, FALSE, FALSE, NULL);
+ emitcode ("inc", "%s", l);
+
if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
IS_AOP_PREG (IC_RESULT (ic)))
- emitcode ("cjne", "%s,#0,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), LSB, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
+ {
+ emitcode ("cjne", "%s,#0,!tlabel", l, tlbl->key + 100);
+ }
else
- {
+ {
emitcode ("clr", "a");
- emitcode ("cjne", "a,%s,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), LSB, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
- }
+ emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100);
+ }
- emitcode ("inc", "%s", aopGet (AOP (IC_RESULT (ic)), MSB16, FALSE, FALSE, FALSE));
+ l = aopGet (AOP (IC_RESULT (ic)), MSB16, FALSE, FALSE, NULL);
+ emitcode ("inc", "%s", l);
if (size > 2)
{
- if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
- IS_AOP_PREG (IC_RESULT (ic)))
- emitcode ("cjne", "%s,#0,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), MSB16, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
- else
- emitcode ("cjne", "a,%s,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), MSB16, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
+ if (!strcmp(l, "acc"))
+ {
+ emitcode("jnz", "!tlabel", tlbl->key + 100);
+ }
+ else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
+ IS_AOP_PREG (IC_RESULT (ic)))
+ {
+ emitcode ("cjne", "%s,#0,!tlabel", l, tlbl->key + 100);
+ }
+ else
+ {
+ emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100);
+ }
- emitcode ("inc", "%s", aopGet (AOP (IC_RESULT (ic)), MSB24, FALSE, FALSE, FALSE));
+ l = aopGet (AOP (IC_RESULT (ic)), MSB24, FALSE, FALSE, NULL);
+ emitcode ("inc", "%s", l);
}
if (size > 3)
{
- if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
- IS_AOP_PREG (IC_RESULT (ic)))
- emitcode ("cjne", "%s,#0,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), MSB24, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
- else
+ if (!strcmp(l, "acc"))
{
- emitcode ("cjne", "a,%s,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), MSB24, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
+ emitcode("jnz", "!tlabel", tlbl->key + 100);
}
- emitcode ("inc", "%s", aopGet (AOP (IC_RESULT (ic)), MSB32, FALSE, FALSE, FALSE));
- }
+ else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
+ IS_AOP_PREG (IC_RESULT (ic)))
+ {
+ emitcode ("cjne", "%s,#0,!tlabel", l, tlbl->key + 100);
+ }
+ else
+ {
+ emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100);
+ }
+
+ l = aopGet (AOP (IC_RESULT (ic)), MSB32, FALSE, FALSE, NULL);
+ emitcode ("inc", "%s", l); }
if (emitTlbl)
{
switch (size) {
case 3:
- emitcode ("mov","dpx,%s",aopGet(AOP (IC_LEFT (ic)), 2, FALSE, FALSE, FALSE));
+ emitcode ("mov","dpx,%s",aopGet(AOP (IC_LEFT (ic)), 2, FALSE, FALSE, NULL));
case 2:
- emitcode ("mov","dph,%s",aopGet(AOP (IC_LEFT (ic)), 1, FALSE, FALSE, FALSE));
+ emitcode ("mov","dph,%s",aopGet(AOP (IC_LEFT (ic)), 1, FALSE, FALSE, NULL));
case 1:
- emitcode ("mov","dpl,%s",aopGet(AOP (IC_LEFT (ic)), 0, FALSE, FALSE, FALSE));
+ emitcode ("mov","dpl,%s",aopGet(AOP (IC_LEFT (ic)), 0, FALSE, FALSE, NULL));
break;
}
while (icount--) emitcode ("inc","dptr");
if (icount > 3)
{
- MOVA (aopGet (AOP (IC_LEFT (ic)), 0, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (IC_LEFT (ic)), 0, FALSE, FALSE, NULL));
emitcode ("add", "a,#!constbyte", ((char) icount) & 0xff);
aopPut (AOP (IC_RESULT (ic)), "a", 0);
}
_startLazyDPSEvaluation ();
while (icount--)
{
- emitcode ("inc", "%s", aopGet (AOP (IC_LEFT (ic)), 0, FALSE, FALSE, FALSE));
+ emitcode ("inc", "%s", aopGet (AOP (IC_LEFT (ic)), 0, FALSE, FALSE, NULL));
}
_endLazyDPSEvaluation ();
}
static void
genPlusBits (iCode * ic)
{
- D (emitcode (";", "genPlusBits ");
- );
+ D (emitcode (";", "genPlusBits "););
+
if (AOP_TYPE (IC_RESULT (ic)) == AOP_CRY)
{
symbol *lbl = newiTempLabel (NULL);
!sameRegs (AOP (IC_RESULT (ic)), AOP (IC_LEFT (ic))))
{
aopPut (AOP (IC_RESULT (ic)),
- aopGet (AOP (IC_LEFT (ic)), GPTRSIZE - 1, FALSE, FALSE, FALSE),
+ aopGet (AOP (IC_LEFT (ic)), GPTRSIZE - 1, FALSE, FALSE, NULL),
GPTRSIZE - 1);
}
!sameRegs (AOP (IC_RESULT (ic)), AOP (IC_RIGHT (ic))))
{
aopPut (AOP (IC_RESULT (ic)),
- aopGet (AOP (IC_RIGHT (ic)), GPTRSIZE - 1, FALSE, FALSE, FALSE),
+ aopGet (AOP (IC_RIGHT (ic)), GPTRSIZE - 1, FALSE, FALSE, NULL),
GPTRSIZE - 1);
}
genPlus (iCode * ic)
{
int size, offset = 0;
- bool pushResult = FALSE;
+ bool pushResult;
int rSize;
D (emitcode (";", "genPlus "););
_startLazyDPSEvaluation ();
while (size--)
{
- MOVA (aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, NULL));
emitcode ("addc", "a,#0");
aopPut (AOP (IC_RESULT (ic)), "a", offset++);
}
{
if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC && !AOP_NEEDSACC(IC_RIGHT(ic)))
{
- MOVA (aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, NULL));
if (offset == 0)
emitcode ("add", "a,%s",
- aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, DP2_RESULT_REG));
else
emitcode ("addc", "a,%s",
- aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, DP2_RESULT_REG));
}
else
{
D(emitcode(";", "+ AOP_ACC special case."););
emitcode("xch", "a, %s", DP2_RESULT_REG);
}
- MOVA (aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, NULL));
if (offset == 0)
{
if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC)
else
{
emitcode ("add", "a,%s",
- aopGet (AOP(IC_LEFT(ic)), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP(IC_LEFT(ic)), offset, FALSE, FALSE,
+ DP2_RESULT_REG));
}
}
else
{
emitcode ("addc", "a,%s",
- aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE,
+ DP2_RESULT_REG));
}
}
if (!pushResult)
if (size == 1 && AOP(IC_LEFT(ic)) == AOP(IC_RESULT(ic)) &&
AOP_TYPE(IC_LEFT(ic)) == AOP_DIR ) {
while (icount--) {
- emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE));
+ emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,NULL));
}
return TRUE;
}
(icount == 1))
{
symbol *tlbl;
- int emitTlbl;
- int labelRange;
+ int emitTlbl;
+ int labelRange;
+ char *l;
/* If the next instruction is a goto and the goto target
* is <= 5 instructions previous to this, we can generate
emitTlbl = 1;
}
- emitcode ("dec", "%s", aopGet (AOP (IC_RESULT (ic)), LSB, FALSE, FALSE, FALSE));
+ l = aopGet (AOP (IC_RESULT (ic)), LSB, FALSE, FALSE, NULL);
+ emitcode ("dec", "%s", l);
+
if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR ||
IS_AOP_PREG (IC_RESULT (ic)))
- emitcode ("cjne", "%s,#!constbyte,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), LSB, FALSE, FALSE, FALSE), 0xff
- ,tlbl->key + 100);
+ {
+ emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100);
+ }
else
- {
+ {
emitcode ("mov", "a,#!constbyte",0xff);
- emitcode ("cjne", "a,%s,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), LSB, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
- }
- emitcode ("dec", "%s", aopGet (AOP (IC_RESULT (ic)), MSB16, FALSE, FALSE, FALSE));
+ emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100);
+ }
+ l = aopGet (AOP (IC_RESULT (ic)), MSB16, FALSE, NULL, NULL);
+ emitcode ("dec", "%s", l);
if (size > 2)
{
- if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
- AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR ||
- IS_AOP_PREG (IC_RESULT (ic)))
- emitcode ("cjne", "%s,#!constbyte,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), MSB16, FALSE, FALSE, FALSE),0xff
- ,tlbl->key + 100);
- else
+ if (!strcmp(l, "acc"))
+ {
+ emitcode("jnz", "!tlabel", tlbl->key + 100);
+ }
+ else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
+ AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR ||
+ IS_AOP_PREG (IC_RESULT (ic)))
+ {
+ emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100);
+ }
+ else
{
- emitcode ("cjne", "a,%s,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), MSB16, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
+ emitcode ("mov", "a,#!constbyte",0xff);
+ emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100);
}
- emitcode ("dec", "%s", aopGet (AOP (IC_RESULT (ic)), MSB24, FALSE, FALSE, FALSE));
+ l = aopGet (AOP (IC_RESULT (ic)), MSB24, FALSE, NULL, NULL);
+ emitcode ("dec", "%s", l);
}
if (size > 3)
{
- if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
- AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR ||
- IS_AOP_PREG (IC_RESULT (ic)))
- emitcode ("cjne", "%s,#!constbyte,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), MSB24, FALSE, FALSE, FALSE),0xff
- ,tlbl->key + 100);
- else
+ if (!strcmp(l, "acc"))
{
- emitcode ("cjne", "a,%s,!tlabel"
- ,aopGet (AOP (IC_RESULT (ic)), MSB24, FALSE, FALSE, FALSE)
- ,tlbl->key + 100);
+ emitcode("jnz", "!tlabel", tlbl->key + 100);
}
- emitcode ("dec", "%s", aopGet (AOP (IC_RESULT (ic)), MSB32, FALSE, FALSE, FALSE));
+ else if (AOP_TYPE (IC_RESULT (ic)) == AOP_REG ||
+ AOP_TYPE (IC_RESULT (ic)) == AOP_DPTR ||
+ IS_AOP_PREG (IC_RESULT (ic)))
+ {
+ emitcode ("cjne", "%s,#!constbyte,!tlabel", l, 0xff, tlbl->key + 100);
+ }
+ else
+ {
+ emitcode ("mov", "a,#!constbyte",0xff);
+ emitcode ("cjne", "a,%s,!tlabel", l, tlbl->key + 100);
+ }
+ l = aopGet (AOP (IC_RESULT (ic)), MSB32, FALSE, NULL, NULL);
+ emitcode ("dec", "%s", l);
}
if (emitTlbl)
{
_startLazyDPSEvaluation ();
while (icount--)
{
- emitcode ("dec", "%s", aopGet (AOP (IC_RESULT (ic)), 0, FALSE, FALSE, FALSE));
+ emitcode ("dec", "%s",
+ aopGet (AOP (IC_RESULT (ic)), 0, FALSE, FALSE, NULL));
}
_endLazyDPSEvaluation ();
{
int size, offset = 0;
int rSize;
- unsigned long lit = 0L;
- bool pushResult = FALSE;
+ long lit = 0L;
+ bool pushResult;
D (emitcode (";", "genMinus "););
}
else
{
- lit = (unsigned long) floatFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit);
- lit = -(long) lit;
+ lit = (long) floatFromVal (AOP (IC_RIGHT (ic))->aopu.aop_lit);
+ lit = -lit;
}
if (AOP_TYPE (IC_RIGHT (ic)) != AOP_LIT) {
if (AOP_USESDPTR(IC_RIGHT(ic))) {
emitcode ("mov","b,%s",
- aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, TRUE));
- MOVA(aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, TRUE));
+ aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, NULL));
+ MOVA(aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, NULL));
emitcode ("subb","a,b");
} else {
- MOVA (aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, NULL));
emitcode ("subb", "a,%s",
- aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (IC_RIGHT (ic)), offset, FALSE, FALSE,
+ DP2_RESULT_REG));
}
} else {
- MOVA (aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (IC_LEFT (ic)), offset, FALSE, FALSE, NULL));
/* first add without previous c */
if (!offset) {
if (!size && lit==-1) {
SPEC_USIGN(operandType(right)))) {
// just an unsigned 8*8=8/16 multiply
//emitcode (";","unsigned");
- emitcode ("mov", "b,%s", aopGet (AOP (right), 0, FALSE, FALSE, TRUE));
- MOVA (aopGet (AOP (left), 0, FALSE, FALSE, TRUE));
+ emitcode ("mov", "b,%s", aopGet (AOP (right), 0, FALSE, FALSE, NULL));
+ MOVA (aopGet (AOP (left), 0, FALSE, FALSE, NULL));
emitcode ("mul", "ab");
_G.accInUse++; _G.bInUse++;
emitcode (";", "signed");
emitcode ("clr", "F0"); // reset sign flag
- MOVA (aopGet (AOP (left), 0, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), 0, FALSE, FALSE, NULL));
lbl=newiTempLabel(NULL);
emitcode ("jnb", "acc.7,!tlabel", lbl->key+100);
} else {
lbl=newiTempLabel(NULL);
emitcode ("mov", "b,a");
- emitcode ("mov", "a,%s", aopGet (AOP (right), 0, FALSE, FALSE, TRUE));
+ emitcode ("mov", "a,%s", aopGet (AOP (right), 0, FALSE, FALSE, NULL));
emitcode ("jnb", "acc.7,!tlabel", lbl->key+100);
// right side is negative, 8-bit two's complement
emitcode ("cpl", "F0"); // complement sign flag
emitcode ("mov","mb,#!constbyte",(val >> 8) & 0xff);
} else {
lbl = newiTempLabel(NULL);
- emitcode ("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,TRUE));
- emitcode ("mov","a,%s",aopGet(AOP(right),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,NULL));
+ emitcode ("mov","a,%s",aopGet(AOP(right),1,FALSE,FALSE,NULL));
emitcode ("jnb","acc.7,!tlabel",lbl->key+100);
emitcode ("xch", "a,b");
emitcode ("cpl","a");
emitcode ("mov","mb,a");
}
} else {
- emitcode ("mov","mb,%s",aopGet(AOP(right),0,FALSE,FALSE,TRUE));
- emitcode ("mov","mb,%s",aopGet(AOP(right),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","mb,%s",aopGet(AOP(right),0,FALSE,FALSE,NULL));
+ emitcode ("mov","mb,%s",aopGet(AOP(right),1,FALSE,FALSE,NULL));
}
/* load up MA with left */
if (!umult) {
lbl = newiTempLabel(NULL);
- emitcode ("mov","b,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
- emitcode ("mov","a,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","b,%s",aopGet(AOP(left),0,FALSE,FALSE,NULL));
+ emitcode ("mov","a,%s",aopGet(AOP(left),1,FALSE,FALSE,NULL));
emitcode ("jnb","acc.7,!tlabel",lbl->key+100);
emitcode ("xch", "a,b");
emitcode ("cpl","a");
emitcode ("mov","ma,b");
emitcode ("mov","ma,a");
} else {
- emitcode ("mov","ma,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
- emitcode ("mov","ma,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","ma,%s",aopGet(AOP(left),0,FALSE,FALSE,NULL));
+ emitcode ("mov","ma,%s",aopGet(AOP(left),1,FALSE,FALSE,NULL));
}
/* wait for multiplication to finish */
lbl = newiTempLabel(NULL);
/* signed is a little bit more difficult */
/* save the signs of the operands */
- l = aopGet (AOP (left), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), 0, FALSE, FALSE, NULL));
emitcode ("xrl", "a,%s", aopGet (AOP (right), 0, FALSE, TRUE, FALSE));
emitcode ("push", "acc"); /* save it on the stack */
/* now sign adjust for both left & right */
- l = aopGet (AOP (right), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (right), 0, FALSE, FALSE, NULL));
lbl = newiTempLabel (NULL);
emitcode ("jnb", "acc.7,!tlabel", (lbl->key + 100));
emitcode ("cpl", "a");
emitcode ("mov", "b,a");
/* sign adjust left side */
- l = aopGet (AOP (left), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA( aopGet (AOP (left), 0, FALSE, FALSE, NULL));
lbl = newiTempLabel (NULL);
emitcode ("jnb", "acc.7,!tlabel", (lbl->key + 100));
if (!umult) {
emitcode("clr","F0");
lbl = newiTempLabel(NULL);
- emitcode ("mov","b,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
- emitcode ("mov","a,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","b,%s",aopGet(AOP(left),0,FALSE,FALSE,NULL));
+ emitcode ("mov","a,%s",aopGet(AOP(left),1,FALSE,FALSE,NULL));
emitcode ("jnb","acc.7,!tlabel",lbl->key+100);
emitcode ("xch", "a,b");
emitcode ("cpl","a");
emitcode ("mov","ma,b");
emitcode ("mov","ma,a");
} else {
- emitcode ("mov","ma,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
- emitcode ("mov","ma,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","ma,%s",aopGet(AOP(left),0,FALSE,FALSE,NULL));
+ emitcode ("mov","ma,%s",aopGet(AOP(left),1,FALSE,FALSE,NULL));
}
/* load up MB with right */
emitcode ("mov","mb,#!constbyte",(val >> 8) & 0xff);
} else {
lbl = newiTempLabel(NULL);
- emitcode ("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,TRUE));
- emitcode ("mov","a,%s",aopGet(AOP(right),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,NULL));
+ emitcode ("mov","a,%s",aopGet(AOP(right),1,FALSE,FALSE,NULL));
emitcode ("jnb","acc.7,!tlabel",lbl->key+100);
emitcode ("xch", "a,b");
emitcode ("cpl","a");
emitcode ("mov","mb,a");
}
} else {
- emitcode ("mov","mb,%s",aopGet(AOP(right),0,FALSE,FALSE,TRUE));
- emitcode ("mov","mb,%s",aopGet(AOP(right),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","mb,%s",aopGet(AOP(right),0,FALSE,FALSE,NULL));
+ emitcode ("mov","mb,%s",aopGet(AOP(right),1,FALSE,FALSE,NULL));
}
/* wait for multiplication to finish */
/* signed is a little bit more difficult */
/* save the signs of the operands */
- l = aopGet (AOP (left), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), 0, FALSE, FALSE, NULL));
emitcode ("xrl", "a,%s", aopGet (AOP (right), 0, FALSE, FALSE, FALSE));
emitcode ("push", "acc"); /* save it on the stack */
/* now sign adjust for both left & right */
- l = aopGet (AOP (right), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (right), 0, FALSE, FALSE, NULL));
lbl = newiTempLabel (NULL);
emitcode ("jnb", "acc.7,!tlabel", (lbl->key + 100));
emitcode ("mov", "b,a");
/* sign adjust left side */
- l = aopGet (AOP (left), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), 0, FALSE, FALSE, NULL));
lbl = newiTempLabel (NULL);
emitcode ("jnb", "acc.7,!tlabel", (lbl->key + 100));
if (!umult) {
lbl = newiTempLabel(NULL);
- emitcode ("mov","b,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
- emitcode ("mov","a,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","b,%s",aopGet(AOP(left),0,FALSE,FALSE,NULL));
+ emitcode ("mov","a,%s",aopGet(AOP(left),1,FALSE,FALSE,NULL));
emitcode ("jnb","acc.7,!tlabel",lbl->key+100);
emitcode ("xch", "a,b");
emitcode ("cpl","a");
emitcode ("mov","ma,b");
emitcode ("mov","ma,a");
} else {
- emitcode ("mov","ma,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
- emitcode ("mov","ma,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","ma,%s",aopGet(AOP(left),0,FALSE,FALSE,NULL));
+ emitcode ("mov","ma,%s",aopGet(AOP(left),1,FALSE,FALSE,NULL));
}
/* load up MB with right */
emitcode ("mov","mb,#!constbyte",(val >> 8) & 0xff);
} else {
lbl = newiTempLabel(NULL);
- emitcode ("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,TRUE));
- emitcode ("mov","a,%s",aopGet(AOP(right),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,NULL));
+ emitcode ("mov","a,%s",aopGet(AOP(right),1,FALSE,FALSE,NULL));
emitcode ("jnb","acc.7,!tlabel",lbl->key+100);
emitcode ("xch", "a,b");
emitcode ("cpl","a");
emitcode ("mov","mb,a");
}
} else {
- emitcode ("mov","mb,%s",aopGet(AOP(right),0,FALSE,FALSE,TRUE));
- emitcode ("mov","mb,%s",aopGet(AOP(right),1,FALSE,FALSE,TRUE));
+ emitcode ("mov","mb,%s",aopGet(AOP(right),0,FALSE,FALSE,NULL));
+ emitcode ("mov","mb,%s",aopGet(AOP(right),1,FALSE,FALSE,NULL));
}
/* wait for multiplication to finish */
unsigned long lit = 0L;
operand *result;
- D (emitcode (";", "genCmp");
- );
+ D (emitcode (";", "genCmp"););
result = IC_RESULT (ic);
size = max (AOP_SIZE (left), AOP_SIZE (right));
/* if unsigned char cmp with lit, do cjne left,#right,zz */
- if ((size == 1) && !sign &&
- (AOP_TYPE (right) == AOP_LIT && AOP_TYPE (left) != AOP_DIR && AOP_TYPE (left) != AOP_STR))
+ if ((size == 1) && !sign
+ && (AOP_TYPE (right) == AOP_LIT && AOP_TYPE (left) != AOP_DIR && AOP_TYPE (left) != AOP_STR))
{
symbol *lbl = newiTempLabel (NULL);
emitcode ("cjne", "%s,%s,!tlabel",
- aopGet (AOP (left), offset, FALSE, FALSE, FALSE),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (left), offset, FALSE, FALSE, NULL),
+ aopGet (AOP (right), offset, FALSE, FALSE, NULL),
lbl->key + 100);
emitcode ("", "!tlabeldef", lbl->key + 100);
}
}
else
{
- MOVA (aopGet (AOP (left), AOP_SIZE (left) - 1, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), AOP_SIZE (left) - 1, FALSE, FALSE, NULL));
freeAsmop (left, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE));
freeAsmop (right, NULL, ic, (RESULTONSTACK (ic) ? FALSE : TRUE));
while (size--)
{
//emitcode (";", "genCmp #1: %d/%d/%d", size, sign, offset);
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
//emitcode (";", "genCmp #2");
if (sign && (size == 0))
{
else
{
//emitcode (";", "genCmp #3.2");
- if (AOP_NEEDSACC (right))
+ if (AOP_NEEDSACC (right) && AOP_TYPE(right) != AOP_DPTR2)
{
emitcode ("push", "acc");
}
- emitcode ("mov", "b,%s", aopGet (AOP (right), offset++,
- FALSE, FALSE, FALSE));
+
+ MOVB(aopGet (AOP (right), offset++, FALSE, FALSE, "b"));
emitcode ("xrl", "b,#!constbyte",0x80);
- if (AOP_NEEDSACC (right))
+
+ if (AOP_NEEDSACC (right) && AOP_TYPE(right) != AOP_DPTR2)
{
emitcode ("pop", "acc");
}
/* Yuck!! */
//emitcode (";", "genCmp #4.1");
emitcode ("xch", "a, b");
- MOVA (aopGet (AOP (right), offset++, FALSE, FALSE, TRUE));
- emitcode ("xch", "a, b");
+ MOVA (aopGet (AOP (right), offset++, FALSE, FALSE, NULL));
+ emitcode ("xch", "a, b");
s = "b";
}
else
{
//emitcode (";", "genCmp #4.2");
- s = aopGet (AOP (right), offset++, FALSE, FALSE, FALSE);
+ s = aopGet (AOP (right), offset++, FALSE, FALSE, DP2_RESULT_REG);
}
emitcode ("subb", "a,%s", s);
* Exclude the generic type byte from the comparison.
*/
size--;
- D (emitcode (";", "cjneshort: generic ptr special case.");
- )
+ D (emitcode (";", "cjneshort: generic ptr special case."););
}
{
while (size--)
{
- char *l = aopGet (AOP (left), offset, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
emitcode ("cjne", "a,%s,!tlabel",
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG),
lbl->key + 100);
offset++;
}
{
while (size--)
{
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
if ((AOP_TYPE (left) == AOP_DIR && AOP_TYPE (right) == AOP_LIT) &&
((unsigned int) ((lit >> (offset * 8)) & 0x0FFL) == 0))
emitcode ("jnz", "!tlabel", lbl->key + 100);
else
emitcode ("cjne", "a,%s,!tlabel",
- aopGet (AOP (right), offset, FALSE, TRUE, FALSE),
+ aopGet (AOP (right), offset, FALSE, TRUE, DP2_RESULT_REG),
lbl->key + 100);
offset++;
}
/* right is a pointer reg need both a & b */
while (size--)
{
- char *l = aopGet (AOP (left), offset, FALSE, FALSE, TRUE);
- if (strcmp (l, "b"))
- emitcode ("mov", "b,%s", l);
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+ MOVB (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
emitcode ("cjne", "a,b,!tlabel", lbl->key + 100);
offset++;
}
_startLazyDPSEvaluation();
for (size = compSize; (size--); offset++)
{
- MOVA (aopGet (AOP (IC_LEFT(ic)), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (IC_LEFT(ic)), offset, FALSE, FALSE, NULL));
emitcode ("mov", "%s, acc", DP2_RESULT_REG);
- MOVA (aopGet (AOP (IC_RIGHT(ic)), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (IC_RIGHT(ic)), offset, FALSE, FALSE, NULL));
emitcode (logicOp, "a,%s", DP2_RESULT_REG);
emitcode ("push", "acc");
operand *left, *right, *result;
int size, offset = 0;
unsigned long lit = 0L;
- int bytelit = 0;
+ int bytelit;
char buff[10];
bool pushResult;
else
{
// c = bit & val;
- MOVA (aopGet (AOP (right), 0, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (right), 0, FALSE, FALSE, NULL));
// c = lsb
emitcode ("rrc", "a");
emitcode ("anl", "c,%s", AOP (left)->aopu.aop_dir);
if (posbit)
{
posbit--;
- MOVA (aopGet (AOP (left), posbit >> 3, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), posbit >> 3, FALSE, FALSE, NULL));
// bit = left & 2^n
if (size)
emitcode ("mov", "c,acc.%d", posbit & 0x07);
{
if ((bytelit = ((lit >> (offset * 8)) & 0x0FFL)) != 0x0L)
{
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
// byte == 2^n ?
if ((posbit = isLiteralBit (bytelit)) != 0)
emitcode ("jb", "acc.%d,!tlabel", (posbit - 1) & 0x07, tlbl->key + 100);
{
if (bytelit != 0x0FFL)
emitcode ("anl", "a,%s",
- aopGet (AOP (right), offset, FALSE, TRUE, FALSE));
+ aopGet (AOP (right), offset, FALSE, TRUE, DP2_RESULT_REG));
emitcode ("jnz", "!tlabel", tlbl->key + 100);
}
}
aopPut (AOP (result), zero, offset);
else if (IS_AOP_PREG (result))
{
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
- emitcode ("anl", "a,%s", aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
+ emitcode ("anl", "a,%s",
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
aopPut (AOP (result), "a", offset);
}
else
emitcode ("anl", "%s,%s",
- aopGet (AOP (left), offset, FALSE, TRUE, FALSE),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (left), offset, FALSE, TRUE, NULL),
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
}
else
{
if (AOP_TYPE (left) == AOP_ACC)
- emitcode ("anl", "a,%s", aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ emitcode ("anl", "a,%s",
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
else
{
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
if (IS_AOP_PREG (result))
{
- emitcode ("anl", "a,%s", aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ emitcode ("anl", "a,%s",
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
aopPut (AOP (result), "a", offset);
-
}
else
emitcode ("anl", "%s,a",
- aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
}
}
}
{
if (AOP_TYPE(right)==AOP_REG && AOP_TYPE(left)==AOP_ACC) {
emitcode ("anl", "a,%s",
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
} else {
if (AOP_TYPE(left)==AOP_ACC) {
emitcode("mov", "b,a");
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
emitcode("anl", "a,b");
}else {
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
emitcode ("anl", "a,%s",
- aopGet (AOP (left), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (left), offset, FALSE, FALSE, DP2_RESULT_REG));
}
}
emitcode ("jnz", "!tlabel", tlbl->key + 100);
if ((bytelit = (int) ((lit >> (offset * 8)) & 0x0FFL)) == 0x0FF)
{
aopPut (AOP (result),
- aopGet (AOP (left), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (left), offset, FALSE, FALSE, NULL),
offset);
continue;
}
continue;
}
D (emitcode (";", "better literal AND."););
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
emitcode ("anl", "a, %s", aopGet (AOP (right), offset,
- FALSE, FALSE, FALSE));
+ FALSE, FALSE, DP2_RESULT_REG));
}
else
// and better if result is SFR
if (AOP_TYPE (left) == AOP_ACC)
{
- emitcode ("anl", "a,%s", aopGet (AOP (right), offset,
- FALSE, FALSE, FALSE));
+ emitcode ("anl", "a,%s",
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
}
else
{
- char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, TRUE);
+ char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, NULL);
if (!strcmp(rOp, "a") || !strcmp(rOp, "acc"))
{
emitcode("mov", "b,a");
rOp = "b";
}
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
emitcode ("anl", "a,%s", rOp);
}
}
{
if (IS_AOP_PREG (left))
{
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
- emitcode ("orl", "a,%s", aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
+ emitcode ("orl", "a,%s",
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
aopPut (AOP (result), "a", offset);
}
else
{
emitcode ("orl", "%s,%s",
- aopGet (AOP (left), offset, FALSE, TRUE, FALSE),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (left), offset, FALSE, TRUE, NULL),
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
}
}
}
{
if (AOP_TYPE (left) == AOP_ACC)
{
- emitcode ("orl", "a,%s", aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ emitcode ("orl", "a,%s",
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
}
else
{
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
if (IS_AOP_PREG (left))
{
- emitcode ("orl", "a,%s", aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ emitcode ("orl", "a,%s",
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
aopPut (AOP (result), "a", offset);
}
else
{
emitcode ("orl", "%s,a",
- aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
}
}
}
{
if (AOP_TYPE(right)==AOP_REG && AOP_TYPE(left)==AOP_ACC) {
emitcode ("orl", "a,%s",
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
} else {
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
emitcode ("orl", "a,%s",
- aopGet (AOP (left), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (left), offset, FALSE, FALSE, DP2_RESULT_REG));
}
emitcode ("jnz", "!tlabel", tlbl->key + 100);
offset++;
if (((lit >> (offset * 8)) & 0x0FFL) == 0x00L)
{
aopPut (AOP (result),
- aopGet (AOP (left), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (left), offset, FALSE, FALSE, NULL),
offset);
continue;
}
D (emitcode (";", "better literal OR."););
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
- emitcode ("orl", "a, %s", aopGet (AOP (right), offset,
- FALSE, FALSE, FALSE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
+ emitcode ("orl", "a, %s",
+ aopGet (AOP (right), offset,
+ FALSE, FALSE, DP2_RESULT_REG));
}
else
// and better if result is SFR
if (AOP_TYPE (left) == AOP_ACC)
{
- emitcode ("orl", "a,%s", aopGet (AOP (right), offset,
- FALSE, FALSE, FALSE));
+ emitcode ("orl", "a,%s",
+ aopGet (AOP (right), offset,
+ FALSE, FALSE, DP2_RESULT_REG));
}
else
{
- char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, TRUE);
+ char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, NULL);
if (!strcmp(rOp, "a") || !strcmp(rOp, "acc"))
{
rOp = "b";
}
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
emitcode ("orl", "a,%s", rOp);
}
}
emitcode ("setb", "c");
while (sizer)
{
- MOVA (aopGet (AOP (right), sizer - 1, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (right), sizer - 1, FALSE, FALSE, NULL));
if (sizer == 1)
// test the msb of the lsb
emitcode ("anl", "a,#!constbyte",0xfe);
continue;
else if (IS_AOP_PREG (left))
{
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
- emitcode ("xrl", "a,%s", aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
+ emitcode ("xrl", "a,%s",
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
aopPut (AOP (result), "a", offset);
}
else
emitcode ("xrl", "%s,%s",
- aopGet (AOP (left), offset, FALSE, TRUE, FALSE),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (left), offset, FALSE, TRUE, NULL),
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
}
else
{
if (AOP_TYPE (left) == AOP_ACC)
- emitcode ("xrl", "a,%s", aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ emitcode ("xrl", "a,%s",
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
else
{
- MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (right), offset, FALSE, FALSE, NULL));
if (IS_AOP_PREG (left))
{
- emitcode ("xrl", "a,%s", aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ emitcode ("xrl", "a,%s",
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
aopPut (AOP (result), "a", offset);
}
else
emitcode ("xrl", "%s,a",
- aopGet (AOP (left), offset, FALSE, TRUE, FALSE));
+ aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG));
}
}
}
if ((AOP_TYPE (right) == AOP_LIT) &&
(((lit >> (offset * 8)) & 0x0FFL) == 0x00L))
{
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
}
else
{
if (AOP_TYPE(right)==AOP_REG && AOP_TYPE(left)==AOP_ACC) {
emitcode ("xrl", "a,%s",
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE));
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
} else {
- char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, TRUE);
+ char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, NULL);
if (!strcmp(rOp, "a") || !strcmp(rOp, "acc"))
{
emitcode("mov", "b,a");
rOp = "b";
}
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
emitcode ("xrl", "a,%s", rOp);
}
}
if (((lit >> (offset * 8)) & 0x0FFL) == 0x00L)
{
aopPut (AOP (result),
- aopGet (AOP (left), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (left), offset, FALSE, FALSE, NULL),
offset);
continue;
}
D (emitcode (";", "better literal XOR."););
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
- emitcode ("xrl", "a, %s", aopGet (AOP (right), offset,
- FALSE, FALSE, FALSE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
+ emitcode ("xrl", "a, %s",
+ aopGet (AOP (right), offset, FALSE, FALSE, DP2_RESULT_REG));
}
else
{
// and better if result is SFR
if (AOP_TYPE (left) == AOP_ACC)
{
- emitcode ("xrl", "a,%s", aopGet (AOP (right), offset,
- FALSE, FALSE, FALSE));
+ emitcode ("xrl", "a,%s",
+ aopGet (AOP (right), offset,
+ FALSE, FALSE, DP2_RESULT_REG));
}
else
{
- char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, TRUE);
+ char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, NULL);
if (!strcmp(rOp, "a") || !strcmp(rOp, "acc"))
{
emitcode("mov", "b,a");
rOp = "b";
}
- MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
emitcode ("xrl", "a,%s", rOp);
}
}
genRRC (iCode * ic)
{
operand *left, *result;
- int size, offset = 0;
- char *l;
+ int size, offset;
- D (emitcode (";", "genRRC ");
- );
+ D (emitcode (";", "genRRC "););
/* rotate right with carry */
left = IC_LEFT (ic);
result = IC_RESULT (ic);
aopOp (left, ic, FALSE, FALSE);
- aopOp (result, ic, FALSE, AOP_TYPE (left) == AOP_DPTR);
+ aopOp (result, ic, FALSE, AOP_USESDPTR(left));
/* move it to the result */
size = AOP_SIZE (result);
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (left), offset, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
emitcode ("rrc", "a");
if (AOP_SIZE (result) > 1)
aopPut (AOP (result), "a", offset--);
highest order byte of the result */
if (AOP_SIZE (result) > 1)
{
- l = aopGet (AOP (result), AOP_SIZE (result) - 1, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (result), AOP_SIZE (result) - 1, FALSE, FALSE, NULL));
}
emitcode ("mov", "acc.7,c");
aopPut (AOP (result), "a", AOP_SIZE (result) - 1);
genRLC (iCode * ic)
{
operand *left, *result;
- int size, offset = 0;
+ int size, offset;
char *l;
- D (emitcode (";", "genRLC ");
- );
+ D (emitcode (";", "genRLC "););
/* rotate right with carry */
left = IC_LEFT (ic);
result = IC_RESULT (ic);
aopOp (left, ic, FALSE, FALSE);
- aopOp (result, ic, FALSE, AOP_TYPE (left) == AOP_DPTR);
+ aopOp (result, ic, FALSE, AOP_USESDPTR(left));
/* move it to the result */
size = AOP_SIZE (result);
offset = 0;
if (size--)
{
- l = aopGet (AOP (left), offset, FALSE, FALSE, TRUE);
+ l = aopGet (AOP (left), offset, FALSE, FALSE, NULL);
MOVA (l);
emitcode ("add", "a,acc");
if (AOP_SIZE (result) > 1)
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (left), offset, FALSE, FALSE, TRUE);
+ l = aopGet (AOP (left), offset, FALSE, FALSE, NULL);
MOVA (l);
emitcode ("rlc", "a");
if (AOP_SIZE (result) > 1)
highest order byte of the result */
if (AOP_SIZE (result) > 1)
{
- l = aopGet (AOP (result), 0, FALSE, FALSE, TRUE);
+ l = aopGet (AOP (result), 0, FALSE, FALSE, NULL);
MOVA (l);
}
emitcode ("mov", "acc.0,c");
left = IC_LEFT (ic);
result = IC_RESULT (ic);
aopOp (left, ic, FALSE, FALSE);
- aopOp (result, ic, FALSE, AOP_TYPE (left) == AOP_DPTR);
+ aopOp (result, ic, FALSE, AOP_USESDPTR(left));
- D (emitcode (";", "genGetHbit ");
- );
+ D (emitcode (";", "genGetHbit "););
/* get the highest order byte into a */
- MOVA (aopGet (AOP (left), AOP_SIZE (left) - 1, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), AOP_SIZE (left) - 1, FALSE, FALSE, NULL));
if (AOP_TYPE (result) == AOP_CRY)
{
emitcode ("rlc", "a");
operand * result, int offr,
int shCount, int sign)
{
- MOVA (aopGet (AOP (left), offl, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offl, FALSE, FALSE, NULL));
/* shift right accumulator */
if (sign)
AccSRsh (shCount);
shiftL1Left2Result (operand * left, int offl,
operand * result, int offr, int shCount)
{
- MOVA(aopGet (AOP (left), offl, FALSE, FALSE, TRUE));
+ MOVA(aopGet (AOP (left), offl, FALSE, FALSE, NULL));
/* shift left accumulator */
AccLsh (shCount);
aopPut (AOP (result), "a", offr);
char *l;
if (!sameRegs (AOP (left), AOP (result)) || (offl != offr))
{
- l = aopGet (AOP (left), offl, FALSE, FALSE, TRUE);
+ l = aopGet (AOP (left), offl, FALSE, FALSE, NULL);
if (*l == '@' && (IS_AOP_PREG (result)))
{
if (AOP_TYPE(left) == AOP_DPTR2)
{
// Get MSB in A.
- MOVA(aopGet(AOP(left), offl + MSB16, FALSE, FALSE, TRUE));
+ MOVA(aopGet(AOP(left), offl + MSB16, FALSE, FALSE, NULL));
// get LSB in DP2_RESULT_REG.
- leftByte = aopGet(AOP(left), offl, FALSE, FALSE, FALSE);
+ leftByte = aopGet(AOP(left), offl, FALSE, FALSE, DP2_RESULT_REG);
assert(!strcmp(leftByte, DP2_RESULT_REG));
}
else
{
// get LSB into DP2_RESULT_REG
- leftByte = aopGet (AOP(left), offl, FALSE, FALSE, TRUE);
+ leftByte = aopGet (AOP(left), offl, FALSE, FALSE, NULL);
if (strcmp(leftByte, DP2_RESULT_REG))
{
TR_AP("#7");
emitcode("mov","%s,%s", DP2_RESULT_REG, leftByte);
}
// And MSB in A.
- leftByte = aopGet(AOP(left), offl + MSB16, FALSE, FALSE, TRUE);
+ leftByte = aopGet(AOP(left), offl + MSB16, FALSE, FALSE, NULL);
assert(strcmp(leftByte, DP2_RESULT_REG));
MOVA(leftByte);
}
((offl + MSB16) == offr))
{
/* don't crash result[offr] */
- MOVA(aopGet(AOP(left), offl, FALSE, FALSE, TRUE));
+ MOVA(aopGet(AOP(left), offl, FALSE, FALSE, NULL));
emitcode ("xch", "a,%s",
- aopGet(AOP(left), offl + MSB16, FALSE, FALSE, FALSE));
+ aopGet(AOP(left), offl + MSB16, FALSE, FALSE, DP2_RESULT_REG));
}
else
{
movLeft2Result (left, offl, result, offr, 0);
- MOVA (aopGet (AOP (left), offl + MSB16, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offl + MSB16, FALSE, FALSE, NULL));
}
- *lsb = aopGet(AOP (result), offr, FALSE, FALSE, FALSE);
+ *lsb = aopGet(AOP (result), offr, FALSE, FALSE, DP2_RESULT_REG);
assert(strcmp(*lsb,"a"));
}
}
shiftLLeftOrResult (operand * left, int offl,
operand * result, int offr, int shCount)
{
- MOVA (aopGet (AOP (left), offl, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offl, FALSE, FALSE, NULL));
/* shift left accumulator */
AccLsh (shCount);
/* or with result */
- emitcode ("orl", "a,%s", aopGet (AOP (result), offr, FALSE, FALSE, FALSE));
+ emitcode ("orl", "a,%s",
+ aopGet (AOP (result), offr, FALSE, FALSE, DP2_RESULT_REG));
/* back to result */
aopPut (AOP (result), "a", offr);
}
shiftRLeftOrResult (operand * left, int offl,
operand * result, int offr, int shCount)
{
- MOVA (aopGet (AOP (left), offl, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), offl, FALSE, FALSE, NULL));
/* shift right accumulator */
AccRsh (shCount);
/* or with result */
- emitcode ("orl", "a,%s", aopGet (AOP (result), offr, FALSE, FALSE, FALSE));
+ emitcode ("orl", "a,%s",
+ aopGet (AOP (result), offr, FALSE, FALSE, DP2_RESULT_REG));
/* back to result */
aopPut (AOP (result), "a", offr);
}
if (size >= LSB + offr)
{
- l = aopGet (AOP (left), LSB, FALSE, FALSE, TRUE);
+ l = aopGet (AOP (left), LSB, FALSE, FALSE, NULL);
MOVA (l);
emitcode ("add", "a,acc");
if (sameRegs (AOP (left), AOP (result)) &&
size >= MSB16 + offr && offr != LSB)
emitcode ("xch", "a,%s",
- aopGet (AOP (left), LSB + offr, FALSE, FALSE, FALSE));
+ aopGet (AOP (left), LSB + offr, FALSE, FALSE, DP2_RESULT_REG));
else
aopPut (AOP (result), "a", LSB + offr);
}
{
if (!(sameRegs (AOP (result), AOP (left)) && size >= MSB16 + offr && offr != LSB))
{
- l = aopGet (AOP (left), MSB16, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), MSB16, FALSE, FALSE, TRUE));
}
emitcode ("rlc", "a");
if (sameRegs (AOP (left), AOP (result)) &&
size >= MSB24 + offr && offr != LSB)
emitcode ("xch", "a,%s",
- aopGet (AOP (left), MSB16 + offr, FALSE, FALSE, FALSE));
+ aopGet (AOP (left), MSB16 + offr, FALSE, FALSE, DP2_RESULT_REG));
else
aopPut (AOP (result), "a", MSB16 + offr);
}
{
if (!(sameRegs (AOP (left), AOP (left)) && size >= MSB24 + offr && offr != LSB))
{
- l = aopGet (AOP (left), MSB24, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), MSB24, FALSE, FALSE, NULL));
}
emitcode ("rlc", "a");
if (sameRegs (AOP (left), AOP (result)) &&
size >= MSB32 + offr && offr != LSB)
emitcode ("xch", "a,%s",
- aopGet (AOP (left), MSB24 + offr, FALSE, FALSE, FALSE));
+ aopGet (AOP (left), MSB24 + offr, FALSE, FALSE, DP2_RESULT_REG));
else
aopPut (AOP (result), "a", MSB24 + offr);
}
{
if (!(sameRegs (AOP (result), AOP (left)) && size >= MSB32 + offr && offr != LSB))
{
- l = aopGet (AOP (left), MSB32, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), MSB32, FALSE, FALSE, NULL));
}
emitcode ("rlc", "a");
aopPut (AOP (result), "a", MSB32 + offr);
freeAsmop (right, NULL, ic, TRUE);
aopOp(left, ic, FALSE, FALSE);
- aopOp(result, ic, FALSE, (AOP_TYPE(left) == AOP_DPTR));
+ aopOp(result, ic, FALSE, AOP_USESDPTR(left));
#if 0 // debug spew
if (IS_SYMOP(left) && OP_SYMBOL(left)->aop)
}
else
{
- emitcode ("mov", "b,%s", aopGet (AOP (right), 0, FALSE, FALSE, FALSE));
- emitcode ("inc", "b");
+ MOVB(aopGet (AOP (right), 0, FALSE, FALSE, "b"));
+ emitcode ("inc", "b");
}
freeAsmop (right, NULL, ic, TRUE);
aopOp (left, ic, FALSE, FALSE);
- aopOp (result, ic, FALSE, AOP_TYPE (left) == AOP_DPTR);
+ aopOp (result, ic, FALSE, AOP_USESDPTR(left));
/* now move the left to the result if they are not the
same */
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (left), offset, FALSE, TRUE, FALSE);
+ l = aopGet (AOP (left), offset, FALSE, TRUE, DP2_RESULT_REG);
if (*l == '@' && (IS_AOP_PREG (result)))
{
{
symbol *tlbl1 = newiTempLabel (NULL);
- l = aopGet (AOP (left), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), 0, FALSE, FALSE, NULL));
emitcode ("sjmp", "!tlabel", tlbl1->key + 100);
emitcode ("", "!tlabeldef", tlbl->key + 100);
emitcode ("add", "a,acc");
emitcode ("sjmp", "!tlabel", tlbl1->key + 100);
emitcode ("", "!tlabeldef", tlbl->key + 100);
- l = aopGet (AOP (result), offset, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (result), offset, FALSE, FALSE, NULL));
emitcode ("add", "a,acc");
aopPut (AOP (result), "a", offset++);
_startLazyDPSEvaluation ();
while (--size)
{
- l = aopGet (AOP (result), offset, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (result), offset, FALSE, FALSE, NULL));
emitcode ("rlc", "a");
aopPut (AOP (result), "a", offset++);
}
werror(E_INTERNAL_ERROR, __FILE__, __LINE__);
}
- MOVA (aopGet (AOP (left), MSB32, FALSE, FALSE));
+ MOVA (aopGet (AOP (left), MSB32, FALSE, NULL));
if (offl==MSB16) {
// shift is > 8
if (sign) {
emitcode ("rlc", "a");
emitcode ("subb", "a,acc");
- emitcode ("xch", "a,%s", aopGet(AOP(left), MSB32, FALSE, FALSE));
+ emitcode ("xch", "a,%s",
+ aopGet(AOP(left), MSB32, FALSE, DP2_RESULT_REG));
} else {
aopPut (AOP(result), zero, MSB32);
}
emitcode ("rrc", "a");
if (isSameRegs && offl==MSB16) {
- emitcode ("xch", "a,%s",aopGet (AOP (left), MSB24, FALSE, FALSE));
+ emitcode ("xch",
+ "a,%s",aopGet (AOP (left), MSB24, FALSE, DP2_RESULT_REG));
} else {
aopPut (AOP (result), "a", MSB32);
- MOVA (aopGet (AOP (left), MSB24, FALSE, FALSE));
+ MOVA (aopGet (AOP (left), MSB24, FALSE, NULL));
}
emitcode ("rrc", "a");
if (isSameRegs && offl==1) {
- emitcode ("xch", "a,%s",aopGet (AOP (left), MSB16, FALSE, FALSE));
+ emitcode ("xch", "a,%s",
+ aopGet (AOP (left), MSB16, FALSE, DP2_RESULT_REG));
} else {
aopPut (AOP (result), "a", MSB24);
- MOVA (aopGet (AOP (left), MSB16, FALSE, FALSE));
+ MOVA (aopGet (AOP (left), MSB16, FALSE, NULL));
}
emitcode ("rrc", "a");
aopPut (AOP (result), "a", MSB16 - offl);
if (offl == LSB)
{
- MOVA (aopGet (AOP (left), LSB, FALSE, FALSE));
+ MOVA (aopGet (AOP (left), LSB, FALSE, NULL));
emitcode ("rrc", "a");
aopPut (AOP (result), "a", LSB);
}
freeAsmop (right, NULL, ic, TRUE);
aopOp (left, ic, FALSE, FALSE);
- aopOp (result, ic, FALSE, AOP_TYPE (left) == AOP_DPTR);
+ aopOp (result, ic, FALSE, AOP_USESDPTR(left));
#if VIEW_SIZE
emitcode ("; shift right ", "result %d, left %d", AOP_SIZE (result),
if (sign)
{
/* get sign in acc.7 */
- MOVA (aopGet (AOP (left), size - 1, FALSE, FALSE, TRUE));
+ MOVA (aopGet (AOP (left), size - 1, FALSE, FALSE, NULL));
}
addSign (result, LSB, sign);
}
}
else
{
- emitcode ("mov", "b,%s", aopGet (AOP (right), 0, FALSE, FALSE, FALSE));
+ MOVB(aopGet (AOP (right), 0, FALSE, FALSE, "b"));
emitcode ("inc", "b");
}
freeAsmop (right, NULL, ic, TRUE);
aopOp (left, ic, FALSE, FALSE);
- aopOp (result, ic, FALSE, AOP_TYPE (left) == AOP_DPTR);
+ aopOp (result, ic, FALSE, AOP_USESDPTR(left));
/* now move the left to the result if they are not the
same */
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (left), offset, FALSE, TRUE, FALSE);
+ l = aopGet (AOP (left), offset, FALSE, TRUE, NULL);
if (*l == '@' && IS_AOP_PREG (result))
{
size = AOP_SIZE (result);
offset = size - 1;
- emitcode ("mov", "a,%s", aopGet (AOP (left), offset, FALSE, FALSE, FALSE));
+ MOVA (aopGet (AOP (left), offset, FALSE, FALSE, NULL));
emitcode ("rlc", "a");
emitcode ("mov", "ov,c");
/* if it is only one byte then */
if (size == 1)
{
- l = aopGet (AOP (left), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA( aopGet (AOP (left), 0, FALSE, FALSE, NULL));
emitcode ("sjmp", "!tlabel", tlbl1->key + 100);
emitcode ("", "!tlabeldef", tlbl->key + 100);
emitcode ("mov", "c,ov");
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (result), offset, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (result), offset, FALSE, FALSE, NULL));
emitcode ("rrc", "a");
aopPut (AOP (result), "a", offset--);
}
}
else
{
- emitcode ("mov", "b,%s", aopGet (AOP (right), 0, FALSE, FALSE, FALSE));
- emitcode ("inc", "b");
+ MOVB(aopGet (AOP (right), 0, FALSE, FALSE, "b"));
+ emitcode ("inc", "b");
}
freeAsmop (right, NULL, ic, TRUE);
aopOp (left, ic, FALSE, FALSE);
- aopOp (result, ic, FALSE, AOP_TYPE (left) == AOP_DPTR);
+ aopOp (result, ic, FALSE, AOP_USESDPTR(left));
/* now move the left to the result if they are not the
same */
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (left), offset, FALSE, TRUE, FALSE);
+ l = aopGet (AOP (left), offset, FALSE, TRUE, NULL);
if (*l == '@' && IS_AOP_PREG (result))
{
/* if it is only one byte then */
if (size == 1)
{
- l = aopGet (AOP (left), 0, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (left), 0, FALSE, FALSE, NULL));
emitcode ("sjmp", "!tlabel", tlbl1->key + 100);
emitcode ("", "!tlabeldef", tlbl->key + 100);
CLRC;
_startLazyDPSEvaluation ();
while (size--)
{
- l = aopGet (AOP (result), offset, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (result), offset, FALSE, FALSE, NULL));
emitcode ("rrc", "a");
aopPut (AOP (result), "a", offset--);
}
genUnpackBits (operand * result, char *rname, int ptype)
{
int shCnt;
- int rlen = 0;
+ int rlen;
sym_link *etype;
int offset = 0;
- D (emitcode (";", "genUnpackBits ");
- );
+ D (emitcode (";", "genUnpackBits "););
etype = getSpec (operandType (result));
/* if we have bitdisplacement then it fits */
/* into this byte completely or if length is */
/* less than a byte */
- if ((shCnt = SPEC_BSTR (etype)) ||
- (SPEC_BLEN (etype) <= 8))
+ if (((shCnt = SPEC_BSTR (etype)) != 0) || (SPEC_BLEN (etype) <= 8))
{
/* shift right acc */
aopOp (result, ic, TRUE, FALSE);
/* get the string representation of the name */
- l = aopGet (AOP (left), 0, FALSE, TRUE, FALSE);
+ l = aopGet (AOP (left), 0, FALSE, TRUE, NULL);
size = AOP_SIZE (result);
_startLazyDPSEvaluation ();
while (size--)
iCode *pi)
{
asmop *aop = NULL;
- regs *preg = NULL;
+ regs *preg;
char *rname;
sym_link *rtype, *retype, *letype;
sym_link *ltype = operandType (left);
preg = getFreePtr (ic, &aop, FALSE);
emitcode ("mov", "%s,%s",
preg->name,
- aopGet (AOP (left), 0, FALSE, TRUE, FALSE));
+ aopGet (AOP (left), 0, FALSE, TRUE, DP2_RESULT_REG));
rname = preg->name;
}
else
- rname = aopGet (AOP (left), 0, FALSE, FALSE, FALSE);
+ rname = aopGet (AOP (left), 0, FALSE, FALSE, DP2_RESULT_REG);
freeAsmop (left, NULL, ic, TRUE);
aopOp (result, ic, FALSE, FALSE);
iCode * pi)
{
asmop *aop = NULL;
- regs *preg = NULL;
+ regs *preg;
char *rname;
sym_link *rtype, *retype, *letype;
preg = getFreePtr (ic, &aop, FALSE);
emitcode ("mov", "%s,%s",
preg->name,
- aopGet (AOP (left), 0, FALSE, TRUE, FALSE));
+ aopGet (AOP (left), 0, FALSE, TRUE, NULL));
rname = preg->name;
}
else
- rname = aopGet (AOP (left), 0, FALSE, FALSE, FALSE);
+ rname = aopGet (AOP (left), 0, FALSE, FALSE, NULL);
freeAsmop (left, NULL, ic, TRUE);
aopOp (result, ic, FALSE, FALSE);
int size, offset, dopi=1;
sym_link *retype = getSpec (operandType (result));
sym_link *letype = getSpec (operandType (left));
- D (emitcode (";", "genFarPointerGet");
- );
+ D (emitcode (";", "genFarPointerGet"););
aopOp (left, ic, FALSE, FALSE);
/* if this is remateriazable */
if (AOP_TYPE (left) == AOP_IMMD)
{
- emitcode ("mov", "dptr,%s", aopGet (AOP (left), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (left), 0, TRUE, FALSE, NULL));
}
else
{
_startLazyDPSEvaluation ();
if (AOP_TYPE (left) != AOP_DPTR)
{
- emitcode ("mov", "dpl,%s", aopGet (AOP (left), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (left), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (left), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (left), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, NULL));
}
else
{
/* We need to generate a load to DPTR indirect through DPTR. */
D (emitcode (";", "genFarPointerGet -- indirection special case.");
);
- emitcode ("push", "%s", aopGet (AOP (left), 0, FALSE, TRUE, TRUE));
- emitcode ("push", "%s", aopGet (AOP (left), 1, FALSE, TRUE, TRUE));
+ emitcode ("push", "%s", aopGet (AOP (left), 0, FALSE, TRUE, NULL));
+ emitcode ("push", "%s", aopGet (AOP (left), 1, FALSE, TRUE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, NULL));
emitcode ("pop", "dph");
emitcode ("pop", "dpl");
dopi =0;
/* if this is remateriazable */
if (AOP_TYPE (left) == AOP_IMMD)
{
- emitcode ("mov", "dptr,%s", aopGet (AOP (left), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (left), 0, TRUE, FALSE, NULL));
}
else
{ /* we need to get it byte by byte */
_startLazyDPSEvaluation ();
if (AOP_TYPE (left) != AOP_DPTR)
{
- emitcode ("mov", "dpl,%s", aopGet (AOP (left), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (left), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (left), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (left), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, NULL));
}
else
{
/* We need to generate a load to DPTR indirect through DPTR. */
D (emitcode (";", "gencodePointerGet -- indirection special case.");
);
- emitcode ("push", "%s", aopGet (AOP (left), 0, FALSE, TRUE, TRUE));
- emitcode ("push", "%s", aopGet (AOP (left), 1, FALSE, TRUE, TRUE));
+ emitcode ("push", "%s", aopGet (AOP (left), 0, FALSE, TRUE, NULL));
+ emitcode ("push", "%s", aopGet (AOP (left), 1, FALSE, TRUE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, NULL));
emitcode ("pop", "dph");
emitcode ("pop", "dpl");
dopi=0;
/* if this is remateriazable */
if (AOP_TYPE (left) == AOP_IMMD)
{
- emitcode ("mov", "dptr,%s", aopGet (AOP (left), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (left), 0, TRUE, FALSE, NULL));
if (AOP(left)->aopu.aop_immd.from_cast_remat)
- emitcode ("mov", "b,%s",aopGet(AOP (left), AOP_SIZE(left)-1, FALSE, FALSE, FALSE));
- else
- emitcode ("mov", "b,#%d", pointerCode (retype));
+ {
+ MOVB(aopGet(AOP (left), AOP_SIZE(left)-1, FALSE, FALSE, NULL));
+ }
+ else
+ {
+ emitcode ("mov", "b,#%d", pointerCode (retype));
+ }
}
else
{ /* we need to get it byte by byte */
_startLazyDPSEvaluation ();
- emitcode ("mov", "dpl,%s", aopGet (AOP(left),0,FALSE,FALSE,TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP(left),1,FALSE,FALSE,TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP(left),0,FALSE,FALSE,NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP(left),1,FALSE,FALSE,NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx,%s", aopGet (AOP(left),2,FALSE,FALSE,TRUE));
- emitcode ("mov", "b,%s", aopGet (AOP(left),3,FALSE,FALSE,TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP(left),2,FALSE,FALSE,NULL));
+ emitcode ("mov", "b,%s", aopGet (AOP(left),3,FALSE,FALSE,NULL));
} else {
- emitcode ("mov", "b,%s", aopGet (AOP(left),2,FALSE,FALSE,TRUE));
+ emitcode ("mov", "b,%s", aopGet (AOP(left),2,FALSE,FALSE,NULL));
}
_endLazyDPSEvaluation ();
}
operand * right,
char *rname, int p_type)
{
- int shCount = 0;
int offset = 0;
- int rLen = 0;
+ int rLen;
int blen, bstr;
char *l;
blen = SPEC_BLEN (etype);
bstr = SPEC_BSTR (etype);
- l = aopGet (AOP (right), offset++, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (right), offset++, FALSE, FALSE, NULL));
/* if the bit lenth is less than or */
/* it exactly fits a byte then */
if (SPEC_BLEN (etype) <= 8)
{
- shCount = SPEC_BSTR (etype);
-
/* shift left acc */
- AccLsh (shCount);
+ AccLsh (SPEC_BSTR (etype));
if (SPEC_BLEN (etype) < 8)
{ /* if smaller than a byte */
while (1)
{
- l = aopGet (AOP (right), offset++, FALSE, TRUE, FALSE);
+ l = aopGet (AOP (right), offset++, FALSE, TRUE, NULL);
rLen -= 8;
if (rLen < 8)
aopOp (right, ic, FALSE, FALSE);
- l = aopGet (AOP (result), 0, FALSE, TRUE, FALSE);
+ l = aopGet (AOP (result), 0, FALSE, TRUE, NULL);
size = AOP_SIZE (right);
while (size--)
{
}
emitcode ("mov", "%s,%s", buff,
- aopGet (AOP (right), offset++, FALSE, FALSE, FALSE));
+ aopGet (AOP (right), offset++, FALSE, FALSE, NULL));
}
freeAsmop (right, NULL, ic, TRUE);
iCode * pi)
{
asmop *aop = NULL;
- regs *preg = NULL;
char *rname, *l;
sym_link *retype, *letype;
sym_link *ptype = operandType (result);
if (!AOP_INPREG (AOP (result)))
{
/* otherwise get a free pointer register */
+ regs *preg;
+
aop = newAsmop (0);
preg = getFreePtr (ic, &aop, FALSE);
emitcode ("mov", "%s,%s",
preg->name,
- aopGet (AOP (result), 0, FALSE, TRUE, FALSE));
+ aopGet (AOP (result), 0, FALSE, TRUE, NULL));
rname = preg->name;
}
else
- rname = aopGet (AOP (result), 0, FALSE, FALSE, FALSE);
+ rname = aopGet (AOP (result), 0, FALSE, FALSE, NULL);
aopOp (right, ic, FALSE, FALSE);
while (size--)
{
- l = aopGet (AOP (right), offset, FALSE, TRUE, FALSE);
+ l = aopGet (AOP (right), offset, FALSE, TRUE, NULL);
if (*l == '@')
{
MOVA (l);
iCode *pi)
{
asmop *aop = NULL;
- regs *preg = NULL;
- char *rname, *l;
+ char *rname;
sym_link *retype, *letype;
retype = getSpec (operandType (right));
if (!AOP_INPREG (AOP (result)))
{
/* otherwise get a free pointer register */
+ regs *preg;
+
aop = newAsmop (0);
preg = getFreePtr (ic, &aop, FALSE);
emitcode ("mov", "%s,%s",
preg->name,
- aopGet (AOP (result), 0, FALSE, TRUE, FALSE));
+ aopGet (AOP (result), 0, FALSE, TRUE, NULL));
rname = preg->name;
}
else
- rname = aopGet (AOP (result), 0, FALSE, FALSE, FALSE);
+ rname = aopGet (AOP (result), 0, FALSE, FALSE, NULL);
aopOp (right, ic, FALSE, FALSE);
while (size--)
{
- l = aopGet (AOP (right), offset, FALSE, TRUE, TRUE);
+ MOVA (aopGet (AOP (right), offset, FALSE, TRUE, NULL));
- MOVA (l);
emitcode ("movx", "@%s,a", rname);
if (size || pi)
{
/* if this is remateriazable */
if (AOP_TYPE (result) == AOP_IMMD)
- emitcode ("mov", "dptr,%s", aopGet (AOP (result), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s",
+ aopGet (AOP (result), 0, TRUE, FALSE, NULL));
else
{
/* we need to get it byte by byte */
_startLazyDPSEvaluation ();
if (AOP_TYPE (result) != AOP_DPTR)
{
- emitcode ("mov", "dpl,%s", aopGet (AOP (result), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (result), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (result), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (result), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (result), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (result), 2, FALSE, FALSE, NULL));
}
else
{
/* We need to generate a load to DPTR indirect through DPTR. */
- D (emitcode (";", "genFarPointerSet -- indirection special case.");
- );
- emitcode ("push", "%s", aopGet (AOP (result), 0, FALSE, TRUE, TRUE));
- emitcode ("push", "%s", aopGet (AOP (result), 1, FALSE, TRUE, TRUE));
+ D (emitcode (";", "genFarPointerSet -- indirection special case."););
+
+ emitcode ("push", "%s", aopGet (AOP (result), 0, FALSE, TRUE, NULL));
+ emitcode ("push", "%s", aopGet (AOP (result), 1, FALSE, TRUE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (result), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (result), 2, FALSE, FALSE, NULL));
emitcode ("pop", "dph");
emitcode ("pop", "dpl");
dopi=0;
offset = 0;
if (AOP_INDPTRn(result) && AOP_USESDPTR(right)) {
while (size--) {
- char *l = aopGet (AOP (right), offset++, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (right), offset++, FALSE, FALSE, NULL));
genSetDPTR(AOP(result)->aopu.dptr);
emitcode ("movx", "@dptr,a");
} else {
_startLazyDPSEvaluation ();
while (size--) {
- char *l = aopGet (AOP (right), offset++, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (right), offset++, FALSE, FALSE, NULL));
if (AOP_INDPTRn(result)) {
genSetDPTR(AOP(result)->aopu.dptr);
/* if this is remateriazable */
if (AOP_TYPE (result) == AOP_IMMD)
{
- emitcode ("mov", "dptr,%s", aopGet (AOP (result), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (result), 0, TRUE, FALSE, NULL));
if (AOP(result)->aopu.aop_immd.from_cast_remat)
- emitcode ("mov", "b,%s",aopGet(AOP (result), AOP_SIZE(result)-1, FALSE, FALSE, FALSE));
+ {
+ MOVB(aopGet(AOP (result), AOP_SIZE(result)-1, FALSE, FALSE, NULL));
+ }
else
- emitcode ("mov", "b,%s + 1", aopGet (AOP (result), 0, TRUE, FALSE, FALSE));
+ {
+ emitcode ("mov",
+ "b,%s + 1", aopGet (AOP (result), 0, TRUE, FALSE, NULL));
+ }
}
else
{ /* we need to get it byte by byte */
- emitcode ("mov", "dpl,%s", aopGet (AOP (result), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (result), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (result), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (result), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx,%s", aopGet (AOP (result), 2, FALSE, FALSE, TRUE));
- emitcode ("mov", "b,%s", aopGet (AOP (result), 3, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (result), 2, FALSE, FALSE, NULL));
+ emitcode ("mov", "b,%s", aopGet (AOP (result), 3, FALSE, FALSE, NULL));
} else {
- emitcode ("mov", "b,%s", aopGet (AOP (result), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "b,%s", aopGet (AOP (result), 2, FALSE, FALSE, NULL));
}
}
_endLazyDPSEvaluation ();
_startLazyDPSEvaluation ();
while (size--)
{
- char *l = aopGet (AOP (right), offset++, FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (right), offset++, FALSE, FALSE, NULL));
genSetDPTR (0);
_flushLazyDPS ();
sym_link *type, *etype;
int p_type;
- D (emitcode (";", "genPointerSet ");
- );
+ D (emitcode (";", "genPointerSet "););
right = IC_RIGHT (ic);
result = IC_RESULT (ic);
{
// Load immediate value into DPTR.
emitcode("mov", "dptr, %s",
- aopGet(AOP(IC_LEFT(ic)), 0, TRUE, FALSE, TRUE));
+ aopGet(AOP(IC_LEFT(ic)), 0, TRUE, FALSE, NULL));
}
else if (AOP_TYPE(IC_LEFT(ic)) != AOP_DPTR)
{
exit(1);
#else
// a regression because of SDCCcse.c:1.52
- emitcode ("mov", "dpl,%s", aopGet (AOP (left), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (left), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (left), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (left), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, NULL));
#endif
}
{
/* quick & easy case. */
D(emitcode(";","genFarFarAssign (1 byte case)"););
- MOVA(aopGet(AOP(right), 0, FALSE, FALSE, TRUE));
+ MOVA(aopGet(AOP(right), 0, FALSE, FALSE, NULL));
freeAsmop (right, NULL, ic, FALSE);
/* now assign DPTR to result */
_G.accInUse++;
while (size--)
{
aopPut (AOP (result),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE), offset);
+ aopGet (AOP (right), offset, FALSE, FALSE, NULL), offset);
offset++;
}
_endLazyDPSEvaluation ();
while (size && ((unsigned int) (lit >> (offset * 8)) != 0))
{
aopPut (AOP (result),
- aopGet (AOP (right), offset, FALSE, FALSE, TRUE),
+ aopGet (AOP (right), offset, FALSE, FALSE, NULL),
offset);
offset++;
size--;
while (size--)
{
aopPut (AOP (result),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (right), offset, FALSE, FALSE, NULL),
offset);
offset++;
}
aopOp (IC_JTCOND (ic), ic, FALSE, FALSE);
/* get the condition into accumulator */
- l = aopGet (AOP (IC_JTCOND (ic)), 0, FALSE, FALSE, TRUE);
+ l = aopGet (AOP (IC_JTCOND (ic)), 0, FALSE, FALSE, NULL);
MOVA (l);
/* multiply by four! */
emitcode ("add", "a,acc");
operand *right = IC_RIGHT (ic);
int size, offset;
- D (emitcode (";", "genCast ");
- );
+ D (emitcode (";", "genCast "););
/* if they are equivalent then do nothing */
if (operandsEqu (IC_RESULT (ic), IC_RIGHT (ic)))
return;
aopOp (right, ic, FALSE, FALSE);
- aopOp (result, ic, FALSE, AOP_TYPE (right) == AOP_DPTR);
+ aopOp (result, ic, FALSE, AOP_USESDPTR(right));
/* if the result is a bit */
// if (AOP_TYPE (result) == AOP_CRY) /* works only for true symbols */
while (size--)
{
aopPut (AOP (result),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (right), offset, FALSE, FALSE, NULL),
offset);
offset++;
}
while (size--)
{
aopPut (AOP (result),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (right), offset, FALSE, FALSE, NULL),
offset);
offset++;
}
while (size--)
{
aopPut (AOP (result),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (right), offset, FALSE, FALSE, NULL),
offset);
offset++;
}
while (size--)
{
aopPut (AOP (result),
- aopGet (AOP (right), offset, FALSE, FALSE, FALSE),
+ aopGet (AOP (right), offset, FALSE, FALSE, NULL),
offset);
offset++;
}
else
{
/* we need to extend the sign :{ */
- char *l = aopGet (AOP (right), AOP_SIZE (right) - 1,
- FALSE, FALSE, TRUE);
- MOVA (l);
+ MOVA (aopGet (AOP (right), AOP_SIZE (right) - 1,
+ FALSE, FALSE, NULL));
emitcode ("rlc", "a");
emitcode ("subb", "a,acc");
while (size--)
* the accumulator, we must explicitly write
* it back after the decrement.
*/
- char *rByte = aopGet(AOP(IC_RESULT(ic)), 0, FALSE, FALSE, TRUE);
+ char *rByte = aopGet(AOP(IC_RESULT(ic)), 0, FALSE, FALSE, NULL);
if (strcmp(rByte, "a"))
{
else if (IS_AOP_PREG (IC_RESULT (ic)))
{
emitcode ("dec", "%s",
- aopGet (AOP (IC_RESULT (ic)), 0, FALSE, FALSE, FALSE));
- emitcode ("mov", "a,%s", aopGet (AOP (IC_RESULT (ic)), 0, FALSE, FALSE, FALSE));
+ aopGet (AOP (IC_RESULT (ic)), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "a,%s", aopGet (AOP (IC_RESULT (ic)), 0, FALSE, FALSE, NULL));
emitcode ("jnz", "!tlabel", lbl->key + 100);
}
else
{
- emitcode ("djnz", "%s,!tlabel", aopGet (AOP (IC_RESULT (ic)), 0, FALSE, TRUE, FALSE),
+ emitcode ("djnz", "%s,!tlabel", aopGet (AOP (IC_RESULT (ic)), 0, FALSE, TRUE, NULL),
lbl->key + 100);
}
emitcode ("sjmp", "!tlabel", lbl1->key + 100);
aopOp (from, ic->next, FALSE, FALSE);
/* get from into DPTR1 */
- emitcode ("mov", "dpl1,%s", aopGet (AOP (from), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph1,%s", aopGet (AOP (from), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl1,%s", aopGet (AOP (from), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph1,%s", aopGet (AOP (from), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx1,%s", aopGet (AOP (from), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx1,%s", aopGet (AOP (from), 2, FALSE, FALSE, NULL));
}
freeAsmop (from, NULL, ic, FALSE);
if (AOP_TYPE (to) != AOP_STR) {
/* if already in DPTR then we need to push */
if (AOP_TYPE(to) == AOP_DPTR) {
- emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, TRUE));
- emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, TRUE));
+ emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, NULL));
+ emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
emitcode ("pop", "dph");
emitcode ("pop", "dpl");
} else {
_startLazyDPSEvaluation ();
/* if this is remateriazable */
if (AOP_TYPE (to) == AOP_IMMD) {
- emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, NULL));
} else { /* we need to get it byte by byte */
- emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
}
}
_endLazyDPSEvaluation ();
/* now for the actual copy */
if (AOP_TYPE(count) == AOP_LIT &&
(int)floatFromVal (AOP(count)->aopu.aop_lit) <= 256) {
- emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,FALSE));
+ emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,NULL));
if (fromc) {
emitcode ("lcall","__bi_memcpyc2x_s");
} else {
symbol *lbl1 = newiTempLabel(NULL);
emitcode (";"," Auto increment but no djnz");
- emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, TRUE));
- emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, TRUE));
+ emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, NULL));
+ emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, NULL));
freeAsmop (count, NULL, ic, FALSE);
emitcode ("mov", "dps,#!constbyte",0x21); /* Select DPTR2 & auto-toggle. */
emitcode ("","!tlabeldef",lbl->key+100);
aopOp (from, ic->next, FALSE, FALSE);
/* get from into DPTR1 */
- emitcode ("mov", "dpl1,%s", aopGet (AOP (from), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph1,%s", aopGet (AOP (from), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl1,%s", aopGet (AOP (from), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph1,%s", aopGet (AOP (from), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx1,%s", aopGet (AOP (from), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx1,%s", aopGet (AOP (from), 2, FALSE, FALSE, NULL));
}
freeAsmop (from, NULL, ic, FALSE);
if (AOP_TYPE (to) != AOP_STR) {
/* if already in DPTR then we need to push */
if (AOP_TYPE(to) == AOP_DPTR) {
- emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, TRUE));
- emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, TRUE));
+ emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, NULL));
+ emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
emitcode ("pop", "dph");
emitcode ("pop", "dpl");
} else {
_startLazyDPSEvaluation ();
/* if this is remateriazable */
if (AOP_TYPE (to) == AOP_IMMD) {
- emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, NULL));
} else { /* we need to get it byte by byte */
- emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
}
}
_endLazyDPSEvaluation ();
/* now for the actual compare */
if (AOP_TYPE(count) == AOP_LIT &&
(int)floatFromVal (AOP(count)->aopu.aop_lit) <= 256) {
- emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,FALSE));
+ emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,NULL));
if (fromc)
emitcode("lcall","__bi_memcmpc2x_s");
else
emitcode("push","ar0");
emitcode (";"," Auto increment but no djnz");
- emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, TRUE));
- emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, TRUE));
+ emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, NULL));
+ emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, NULL));
freeAsmop (count, NULL, ic, FALSE);
emitcode ("mov", "dps,#!constbyte",0x21); /* Select DPTR2 & auto-toggle. */
emitcode ("","!tlabeldef",lbl->key+100);
aopOp (from, ic->next, FALSE, FALSE);
/* get from into DPTR1 */
- emitcode ("mov", "dpl1,%s", aopGet (AOP (from), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph1,%s", aopGet (AOP (from), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl1,%s", aopGet (AOP (from), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph1,%s", aopGet (AOP (from), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx1,%s", aopGet (AOP (from), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx1,%s", aopGet (AOP (from), 2, FALSE, FALSE, NULL));
}
freeAsmop (from, NULL, ic, FALSE);
if (AOP_TYPE (to) != AOP_STR) {
/* if already in DPTR then we need to push */
if (AOP_TYPE(to) == AOP_DPTR) {
- emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, TRUE));
- emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, TRUE));
+ emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, NULL));
+ emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
emitcode ("pop", "dph");
emitcode ("pop", "dpl");
} else {
_startLazyDPSEvaluation ();
/* if this is remateriazable */
if (AOP_TYPE (to) == AOP_IMMD) {
- emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, NULL));
} else { /* we need to get it byte by byte */
- emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
}
}
_endLazyDPSEvaluation ();
(int)floatFromVal (AOP(count)->aopu.aop_lit) <= 256) {
emitcode (";","OH JOY auto increment with djnz (very fast)");
emitcode ("mov", "dps,#!constbyte",0x1); /* Select DPTR2 */
- emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,FALSE));
+ emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,NULL));
freeAsmop (count, NULL, ic, FALSE);
emitcode ("","!tlabeldef",lbl->key+100);
emitcode ("movx", "a,@dptr"); /* read data from port */
symbol *lbl1 = newiTempLabel(NULL);
emitcode (";"," Auto increment but no djnz");
- emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, TRUE));
- emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, TRUE));
+ emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, NULL));
+ emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, NULL));
freeAsmop (count, NULL, ic, FALSE);
emitcode ("mov", "dps,#!constbyte",0x1); /* Select DPTR2 */
emitcode ("","!tlabeldef",lbl->key+100);
aopOp (from, ic->next, FALSE, FALSE);
/* get from into DPTR1 */
- emitcode ("mov", "dpl1,%s", aopGet (AOP (from), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph1,%s", aopGet (AOP (from), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl1,%s", aopGet (AOP (from), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph1,%s", aopGet (AOP (from), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx1,%s", aopGet (AOP (from), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx1,%s", aopGet (AOP (from), 2, FALSE, FALSE, NULL));
}
freeAsmop (from, NULL, ic, FALSE);
if (AOP_TYPE (to) != AOP_STR) {
/* if already in DPTR then we need to push */
if (AOP_TYPE(to) == AOP_DPTR) {
- emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, TRUE));
- emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, TRUE));
+ emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, NULL));
+ emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
emitcode ("pop", "dph");
emitcode ("pop", "dpl");
} else {
_startLazyDPSEvaluation ();
/* if this is remateriazable */
if (AOP_TYPE (to) == AOP_IMMD) {
- emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, NULL));
} else { /* we need to get it byte by byte */
- emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
}
}
_endLazyDPSEvaluation ();
(int)floatFromVal (AOP(count)->aopu.aop_lit) <= 256) {
emitcode (";","OH JOY auto increment with djnz (very fast)");
emitcode ("mov", "dps,#!constbyte",0x0); /* Select DPTR */
- emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,FALSE));
+ emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,NULL));
emitcode ("","!tlabeldef",lbl->key+100);
emitcode ("movx", "a,@dptr"); /* read data from port */
emitcode ("inc","dps"); /* switch to DPTR2 */
symbol *lbl1 = newiTempLabel(NULL);
emitcode (";"," Auto increment but no djnz");
- emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, TRUE));
- emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, TRUE));
+ emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, NULL));
+ emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, NULL));
freeAsmop (count, NULL, ic, FALSE);
emitcode ("mov", "dps,#!constbyte",0x0); /* Select DPTR */
emitcode ("","!tlabeldef",lbl->key+100);
assert(getSize(operandType(src))==2);
aopOp (src, ic, FALSE, FALSE);
- emitcode ("mov","a,%s",aopGet(AOP(src),0,FALSE,FALSE,TRUE));
+ emitcode ("mov","a,%s",aopGet(AOP(src),0,FALSE,FALSE,NULL));
_G.accInUse++;
- emitcode ("mov","b,%s",aopGet(AOP(src),1,FALSE,FALSE,FALSE));
+ MOVB(aopGet(AOP(src),1,FALSE,FALSE,"b"));
_G.accInUse--;
freeAsmop (src, NULL, ic, FALSE);
symbol *lbl;
char *l;
int i;
- bitVect *rsave = NULL;
+ bitVect *rsave;
/* we know it has to be 3 parameters */
assert (nparms == 3);
if (AOP_TYPE (to) != AOP_STR) {
/* if already in DPTR then we need to push */
if (AOP_TYPE(to) == AOP_DPTR) {
- emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, TRUE));
- emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, TRUE));
+ emitcode ("push", "%s", aopGet (AOP (to), 0, FALSE, TRUE, NULL));
+ emitcode ("push", "%s", aopGet (AOP (to), 1, FALSE, TRUE, NULL));
if (options.model == MODEL_FLAT24)
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
emitcode ("pop", "dph");
emitcode ("pop", "dpl");
} else {
_startLazyDPSEvaluation ();
/* if this is remateriazable */
if (AOP_TYPE (to) == AOP_IMMD) {
- emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s", aopGet (AOP (to), 0, TRUE, FALSE, NULL));
} else { /* we need to get it byte by byte */
- emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, TRUE));
- emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpl,%s", aopGet (AOP (to), 0, FALSE, FALSE, NULL));
+ emitcode ("mov", "dph,%s", aopGet (AOP (to), 1, FALSE, FALSE, NULL));
if (options.model == MODEL_FLAT24) {
- emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, TRUE));
+ emitcode ("mov", "dpx,%s", aopGet (AOP (to), 2, FALSE, FALSE, NULL));
}
}
_endLazyDPSEvaluation ();
/* now for the actual copy */
if (AOP_TYPE(count) == AOP_LIT &&
(int)floatFromVal (AOP(count)->aopu.aop_lit) <= 256) {
- l = aopGet(AOP (val), 0, FALSE, FALSE, TRUE);
- emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,FALSE));
+ l = aopGet(AOP (val), 0, FALSE, FALSE, NULL);
+ emitcode ("mov", "b,%s",aopGet(AOP(count),0,FALSE,FALSE,NULL));
MOVA(l);
emitcode ("","!tlabeldef",lbl->key+100);
emitcode ("movx", "@dptr,a");
} else {
symbol *lbl1 = newiTempLabel(NULL);
- emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, TRUE));
- emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, TRUE));
+ emitcode ("mov","_ap,%s",aopGet (AOP (count), 0, FALSE, TRUE, NULL));
+ emitcode ("mov","b,%s",aopGet (AOP (count), 1, FALSE, TRUE, NULL));
emitcode ("","!tlabeldef",lbl->key+100);
- l = aopGet(AOP (val), 0, FALSE, FALSE, TRUE);
- MOVA(l);
+ MOVA (aopGet(AOP (val), 0, FALSE, FALSE, NULL));
emitcode ("movx", "@dptr,a");
emitcode ("inc", "dptr");
emitcode ("mov","a,b");
pnum = parms[0];
aopOp (pnum, ic, FALSE, FALSE);
- emitcode ("mov","a,%s",aopGet(AOP(pnum),0,FALSE,FALSE,FALSE));
+ emitcode ("mov","a,%s",aopGet(AOP(pnum),0,FALSE,FALSE,DP2_RESULT_REG));
freeAsmop (pnum, NULL, ic, FALSE);
emitcode ("lcall","NatLib_LoadPrimitive");
aopOp (result=IC_RESULT(ic), ic, FALSE, FALSE);
emitcode ("push","a%s",javaRet[i]);
}
for (i=0; i < size ; i++ ) {
- emitcode ("pop","a%s",aopGet(AOP(result),i,FALSE,FALSE,FALSE));
+ emitcode ("pop","a%s",
+ aopGet(AOP(result),i,FALSE,FALSE,DP2_RESULT_REG));
}
} else {
for (i = 0 ; i < size ; i++ ) {
pnum = parms[0];
aopOp (pnum, ic, FALSE, FALSE);
- emitcode ("mov","a,%s",aopGet(AOP(pnum),0,FALSE,FALSE,FALSE));
+ emitcode ("mov","a,%s",aopGet(AOP(pnum),0,FALSE,FALSE,DP2_RESULT_REG));
freeAsmop (pnum, NULL, ic, FALSE);
emitcode ("lcall","NatLib_LoadPointer");
aopOp (result=IC_RESULT(ic), ic, FALSE, FALSE);
aopOp (psb, ic, FALSE, FALSE);
if (AOP_TYPE (psb) == AOP_IMMD) {
emitcode ("mov","dps,#1");
- emitcode ("mov", "dptr,%s", aopGet (AOP (psb), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s",
+ aopGet (AOP (psb), 0, TRUE, FALSE, DP2_RESULT_REG));
emitcode ("mov","dps,#0");
} else {
- emitcode ("mov","dpl1,%s",aopGet(AOP(psb),0,FALSE,FALSE,FALSE));
- emitcode ("mov","dph1,%s",aopGet(AOP(psb),1,FALSE,FALSE,FALSE));
- emitcode ("mov","dpx1,%s",aopGet(AOP(psb),2,FALSE,FALSE,FALSE));
+ emitcode ("mov","dpl1,%s",aopGet(AOP(psb),0,FALSE,FALSE,DP2_RESULT_REG));
+ emitcode ("mov","dph1,%s",aopGet(AOP(psb),1,FALSE,FALSE,DP2_RESULT_REG));
+ emitcode ("mov","dpx1,%s",aopGet(AOP(psb),2,FALSE,FALSE,DP2_RESULT_REG));
}
freeAsmop (psb, NULL, ic, FALSE);
/* put handle into r3:r2 */
aopOp (handle, ic, FALSE, FALSE);
if (aopHasRegs(AOP(handle),R2_IDX,R3_IDX)) {
- emitcode ("push","%s",aopGet(AOP(handle),0,FALSE,TRUE,FALSE));
- emitcode ("push","%s",aopGet(AOP(handle),1,FALSE,TRUE,FALSE));
+ emitcode ("push","%s",aopGet(AOP(handle),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("push","%s",aopGet(AOP(handle),1,FALSE,TRUE,DP2_RESULT_REG));
emitcode ("pop","ar3");
emitcode ("pop","ar2");
} else {
- emitcode ("mov","r2,%s",aopGet(AOP(handle),0,FALSE,TRUE,FALSE));
- emitcode ("mov","r3,%s",aopGet(AOP(handle),1,FALSE,TRUE,FALSE));
+ emitcode ("mov","r2,%s",aopGet(AOP(handle),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("mov","r3,%s",aopGet(AOP(handle),1,FALSE,TRUE,DP2_RESULT_REG));
}
freeAsmop (psb, NULL, ic, FALSE);
if (aopHasRegs(AOP(IC_RESULT(ic)),R2_IDX,R3_IDX)) {
emitcode ("push","ar3");
emitcode ("push","ar2");
- emitcode ("pop","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,TRUE,FALSE));
- emitcode ("pop","%s",aopGet(AOP(IC_RESULT(ic)),1,FALSE,TRUE,FALSE));
+ emitcode ("pop","%s",
+ aopGet(AOP(IC_RESULT(ic)),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("pop","%s",
+ aopGet(AOP(IC_RESULT(ic)),1,FALSE,TRUE,DP2_RESULT_REG));
} else {
aopPut(AOP(IC_RESULT(ic)),"r2",0);
aopPut(AOP(IC_RESULT(ic)),"r3",1);
/* put the size in R4-R2 */
if (aopHasRegs(AOP(bsize),R2_IDX, (size==3 ? R4_IDX: R3_IDX))) {
- emitcode("push","%s",aopGet(AOP(bsize),0,FALSE,TRUE,FALSE));
- emitcode("push","%s",aopGet(AOP(bsize),1,FALSE,TRUE,FALSE));
+ emitcode("push","%s",aopGet(AOP(bsize),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode("push","%s",aopGet(AOP(bsize),1,FALSE,TRUE,DP2_RESULT_REG));
if (size==3) {
- emitcode("push","%s",aopGet(AOP(bsize),2,FALSE,TRUE,FALSE));
+ emitcode("push","%s",aopGet(AOP(bsize),2,FALSE,TRUE,DP2_RESULT_REG));
emitcode("pop","ar4");
}
emitcode("pop","ar3");
emitcode("pop","ar2");
} else {
- emitcode ("mov","r2,%s",aopGet(AOP(bsize),0,FALSE,TRUE,FALSE));
- emitcode ("mov","r3,%s",aopGet(AOP(bsize),1,FALSE,TRUE,FALSE));
+ emitcode ("mov","r2,%s",aopGet(AOP(bsize),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("mov","r3,%s",aopGet(AOP(bsize),1,FALSE,TRUE,DP2_RESULT_REG));
if (size==3) {
- emitcode("mov","r4,%s",aopGet(AOP(bsize),2,FALSE,TRUE,FALSE));
+ emitcode("mov","r4,%s",aopGet(AOP(bsize),2,FALSE,TRUE,DP2_RESULT_REG));
}
}
freeAsmop (bsize, NULL, ic, FALSE);
if (aopHasRegs(AOP(IC_RESULT(ic)),R2_IDX,R3_IDX)) {
emitcode ("push","ar3");
emitcode ("push","ar2");
- emitcode ("pop","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,TRUE,FALSE));
- emitcode ("pop","%s",aopGet(AOP(IC_RESULT(ic)),1,FALSE,TRUE,FALSE));
+ emitcode ("pop","%s",
+ aopGet(AOP(IC_RESULT(ic)),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("pop","%s",
+ aopGet(AOP(IC_RESULT(ic)),1,FALSE,TRUE,DP2_RESULT_REG));
} else {
aopPut(AOP(IC_RESULT(ic)),"r2",0);
aopPut(AOP(IC_RESULT(ic)),"r3",1);
/* put the size in R4-R2 */
if (aopHasRegs(AOP(handle),R2_IDX,R3_IDX)) {
- emitcode("push","%s",aopGet(AOP(handle),0,FALSE,TRUE,FALSE));
- emitcode("push","%s",aopGet(AOP(handle),1,FALSE,TRUE,FALSE));
+ emitcode("push","%s",
+ aopGet(AOP(handle),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode("push","%s",
+ aopGet(AOP(handle),1,FALSE,TRUE,DP2_RESULT_REG));
emitcode("pop","ar3");
emitcode("pop","ar2");
} else {
- emitcode ("mov","r2,%s",aopGet(AOP(handle),0,FALSE,TRUE,FALSE));
- emitcode ("mov","r3,%s",aopGet(AOP(handle),1,FALSE,TRUE,FALSE));
+ emitcode ("mov","r2,%s",
+ aopGet(AOP(handle),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("mov","r3,%s",
+ aopGet(AOP(handle),1,FALSE,TRUE,DP2_RESULT_REG));
}
freeAsmop (handle, NULL, ic, FALSE);
/* put the size in R3-R2 */
if (aopHasRegs(AOP(handle),R2_IDX,R3_IDX)) {
- emitcode("push","%s",aopGet(AOP(handle),0,FALSE,TRUE,FALSE));
- emitcode("push","%s",aopGet(AOP(handle),1,FALSE,TRUE,FALSE));
+ emitcode("push","%s",
+ aopGet(AOP(handle),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode("push","%s",
+ aopGet(AOP(handle),1,FALSE,TRUE,DP2_RESULT_REG));
emitcode("pop","ar3");
emitcode("pop","ar2");
} else {
- emitcode ("mov","r2,%s",aopGet(AOP(handle),0,FALSE,TRUE,FALSE));
- emitcode ("mov","r3,%s",aopGet(AOP(handle),1,FALSE,TRUE,FALSE));
+ emitcode ("mov","r2,%s",
+ aopGet(AOP(handle),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("mov","r3,%s",
+ aopGet(AOP(handle),1,FALSE,TRUE,DP2_RESULT_REG));
}
freeAsmop (handle, NULL, ic, FALSE);
/* put the handle in R3-R2 */
aopOp (handle,ic,FALSE,FALSE);
if (aopHasRegs(AOP(handle),R2_IDX,R3_IDX)) {
- emitcode("push","%s",aopGet(AOP(handle),0,FALSE,TRUE,FALSE));
- emitcode("push","%s",aopGet(AOP(handle),1,FALSE,TRUE,FALSE));
+ emitcode("push","%s",
+ aopGet(AOP(handle),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode("push","%s",
+ aopGet(AOP(handle),1,FALSE,TRUE,DP2_RESULT_REG));
emitcode("pop","ar3");
emitcode("pop","ar2");
} else {
- emitcode ("mov","r2,%s",aopGet(AOP(handle),0,FALSE,TRUE,FALSE));
- emitcode ("mov","r3,%s",aopGet(AOP(handle),1,FALSE,TRUE,FALSE));
+ emitcode ("mov","r2,%s",
+ aopGet(AOP(handle),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("mov","r3,%s",
+ aopGet(AOP(handle),1,FALSE,TRUE,DP2_RESULT_REG));
}
freeAsmop (handle, NULL, ic, FALSE);
/* put pointer in DPTR */
aopOp (pp,ic,FALSE,FALSE);
if (AOP_TYPE(pp) == AOP_IMMD) {
- emitcode ("mov", "dptr,%s", aopGet (AOP (pp), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s",
+ aopGet (AOP (pp), 0, TRUE, FALSE, NULL));
} else if (AOP_TYPE(pp) != AOP_STR) { /* not already in dptr */
- emitcode ("mov","dpl,%s",aopGet(AOP(pp),0,FALSE,FALSE,FALSE));
- emitcode ("mov","dph,%s",aopGet(AOP(pp),1,FALSE,FALSE,FALSE));
- emitcode ("mov","dpx,%s",aopGet(AOP(pp),2,FALSE,FALSE,FALSE));
+ emitcode ("mov","dpl,%s",aopGet(AOP(pp),0,FALSE,FALSE,NULL));
+ emitcode ("mov","dph,%s",aopGet(AOP(pp),1,FALSE,FALSE,NULL));
+ emitcode ("mov","dpx,%s",aopGet(AOP(pp),2,FALSE,FALSE,NULL));
}
freeAsmop (handle, NULL, ic, FALSE);
aopOp (pp,ic,FALSE,FALSE);
if (AOP_TYPE (pp) == AOP_IMMD) {
emitcode ("mov","dps,#1");
- emitcode ("mov", "dptr,%s", aopGet (AOP (pp), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s",
+ aopGet (AOP (pp), 0, TRUE, FALSE, NULL));
emitcode ("mov","dps,#0");
} else {
- emitcode ("mov","dpl1,%s",aopGet(AOP(pp),0,FALSE,FALSE,FALSE));
- emitcode ("mov","dph1,%s",aopGet(AOP(pp),1,FALSE,FALSE,FALSE));
- emitcode ("mov","dpx1,%s",aopGet(AOP(pp),2,FALSE,FALSE,FALSE));
+ emitcode ("mov","dpl1,%s",
+ aopGet(AOP(pp),0,FALSE,FALSE,DP2_RESULT_REG));
+ emitcode ("mov","dph1,%s",
+ aopGet(AOP(pp),1,FALSE,FALSE,DP2_RESULT_REG));
+ emitcode ("mov","dpx1,%s",
+ aopGet(AOP(pp),2,FALSE,FALSE,DP2_RESULT_REG));
}
freeAsmop (pp, NULL, ic, FALSE);
aopOp(to,ic,FALSE,FALSE);
if (aopHasRegs(AOP(to),R2_IDX,R3_IDX) ||
aopHasRegs(AOP(to),R0_IDX,R1_IDX) ) {
- emitcode ("push","%s",aopGet(AOP(to),0,FALSE,TRUE,FALSE));
- emitcode ("push","%s",aopGet(AOP(to),1,FALSE,TRUE,FALSE));
- emitcode ("push","%s",aopGet(AOP(to),2,FALSE,TRUE,FALSE));
- emitcode ("push","%s",aopGet(AOP(to),3,FALSE,TRUE,FALSE));
+ emitcode ("push","%s",
+ aopGet(AOP(to),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("push","%s",
+ aopGet(AOP(to),1,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("push","%s",
+ aopGet(AOP(to),2,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("push","%s",
+ aopGet(AOP(to),3,FALSE,TRUE,DP2_RESULT_REG));
emitcode ("pop","ar3");
emitcode ("pop","ar2");
emitcode ("pop","ar1");
emitcode ("pop","ar0");
} else {
- emitcode ("mov","r0,%s",aopGet(AOP(to),0,FALSE,TRUE,FALSE));
- emitcode ("mov","r1,%s",aopGet(AOP(to),1,FALSE,TRUE,FALSE));
- emitcode ("mov","r2,%s",aopGet(AOP(to),2,FALSE,TRUE,FALSE));
- emitcode ("mov","r3,%s",aopGet(AOP(to),3,FALSE,TRUE,FALSE));
+ emitcode ("mov","r0,%s",
+ aopGet(AOP(to),0,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("mov","r1,%s",
+ aopGet(AOP(to),1,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("mov","r2,%s",
+ aopGet(AOP(to),2,FALSE,TRUE,DP2_RESULT_REG));
+ emitcode ("mov","r3,%s",
+ aopGet(AOP(to),3,FALSE,TRUE,DP2_RESULT_REG));
}
freeAsmop (to, NULL, ic, FALSE);
/* suspend in acc */
s = parms[1];
aopOp(s,ic,FALSE,FALSE);
- emitcode ("mov","a,%s",aopGet(AOP(s),0,FALSE,TRUE,FALSE));
+ emitcode ("mov","a,%s",
+ aopGet(AOP(s),0,FALSE,TRUE,NULL));
freeAsmop (s, NULL, ic, FALSE);
/* make the call */
/* PID in R0 */
aopOp(pid,ic,FALSE,FALSE);
- emitcode ("mov","r0,%s",aopGet(AOP(pid),0,FALSE,TRUE,FALSE));
+ emitcode ("mov","r0,%s",
+ aopGet(AOP(pid),0,FALSE,TRUE,DP2_RESULT_REG));
freeAsmop (pid, NULL, ic, FALSE);
/* tid into ACC */
aopOp(tid,ic,FALSE,FALSE);
- emitcode ("mov","a,%s",aopGet(AOP(tid),0,FALSE,TRUE,FALSE));
+ emitcode ("mov","a,%s",
+ aopGet(AOP(tid),0,FALSE,TRUE,DP2_RESULT_REG));
freeAsmop (tid, NULL, ic, FALSE);
emitcode ("lcall","System_ThreadResume");
/* pid into ACC */
aopOp(pid,ic,FALSE,FALSE);
- emitcode ("mov","a,%s",aopGet(AOP(pid),0,FALSE,TRUE,FALSE));
+ emitcode ("mov","a,%s",
+ aopGet(AOP(pid),0,FALSE,TRUE,DP2_RESULT_REG));
freeAsmop (pid, NULL, ic, FALSE);
emitcode ("lcall","System_ProcessResume");
fp = parms[0];
aopOp (fp,ic,FALSE,FALSE);
if (AOP_TYPE (fp) == AOP_IMMD) {
- emitcode ("mov", "dptr,%s", aopGet (AOP (fp), 0, TRUE, FALSE, FALSE));
+ emitcode ("mov", "dptr,%s",
+ aopGet (AOP (fp), 0, TRUE, FALSE, DP2_RESULT_REG));
} else if (AOP_TYPE(fp) != AOP_STR) { /* not already in dptr */
- emitcode ("mov","dpl,%s",aopGet(AOP(fp),0,FALSE,FALSE,FALSE));
- emitcode ("mov","dph,%s",aopGet(AOP(fp),1,FALSE,FALSE,FALSE));
- emitcode ("mov","dpx,%s",aopGet(AOP(fp),2,FALSE,FALSE,FALSE));
+ emitcode ("mov","dpl,%s",
+ aopGet(AOP(fp),0,FALSE,FALSE,DP2_RESULT_REG));
+ emitcode ("mov","dph,%s",
+ aopGet(AOP(fp),1,FALSE,FALSE,DP2_RESULT_REG));
+ emitcode ("mov","dpx,%s",
+ aopGet(AOP(fp),2,FALSE,FALSE,DP2_RESULT_REG));
}
freeAsmop (fp, NULL, ic, FALSE);