instruction, in which case we are in trouble */
if ((r0iu = bitVectBitValue(ic->rUsed,R0_IDX)) &&
(r1iu = bitVectBitValue(ic->rUsed,R1_IDX)))
+ {
goto endOfWorld;
-
+ }
r0ou = bitVectBitValue(ic->rMask,R0_IDX);
r1ou = bitVectBitValue(ic->rMask,R1_IDX);
if (!r0iu && !r0ou) {
ic->rUsed = bitVectSetBit(ic->rUsed,R0_IDX);
(*aopp)->type = AOP_R0;
+
return (*aopp)->aopu.aop_ptr = mcs51_regWithIdx(R0_IDX);
}
if (!r1iu && !r1ou) {
ic->rUsed = bitVectSetBit(ic->rUsed,R1_IDX);
(*aopp)->type = AOP_R1;
+
return (*aopp)->aopu.aop_ptr = mcs51_regWithIdx(R1_IDX);
}
mcs51_regWithIdx(R0_IDX)->dname);
_G.r0Pushed++ ;
}
-
+
ic->rUsed = bitVectSetBit(ic->rUsed,R0_IDX);
(*aopp)->type = AOP_R0;
mcs51_regWithIdx(R1_IDX)->dname);
_G.r1Pushed++ ;
}
-
+
ic->rUsed = bitVectSetBit(ic->rUsed,R1_IDX);
(*aopp)->type = AOP_R1;
return mcs51_regWithIdx(R1_IDX);
}
-
endOfWorld :
/* I said end of world but not quite end of world yet */
- /* if this is a result then we canpush it on the stack*/
+ /* if this is a result then we can push it on the stack*/
if (result) {
(*aopp)->type = AOP_STK;
return NULL;
emitcode ("push","dpl");
if (!inExcludeList("dph"))
emitcode ("push","dph");
-
+ if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
+ emitcode ("push", "dpx");
/* if this isr has no bank i.e. is going to
run with bank 0 , then we need to save more
registers :-) */
}
}
+ if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
+ emitcode ("pop", "dpx");
if (!inExcludeList("dph"))
emitcode ("pop","dph");
if (!inExcludeList("dpl"))
else { /* we need to get it byte by byte */
emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE));
emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE));
+ if (options.model == MODEL_FLAT24)
+ {
+ emitcode("mov", "dpx,%s",aopGet(AOP(left),2,FALSE,FALSE));
+ }
}
}
/* so dptr know contains the address */
else { /* we need to get it byte by byte */
emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE));
emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE));
+ if (options.model == MODEL_FLAT24)
+ {
+ emitcode("mov", "dpx,%s",aopGet(AOP(left),2,FALSE,FALSE));
+ }
}
}
/* so dptr know contains the address */
else { /* we need to get it byte by byte */
emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE));
emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE));
- emitcode("mov","b,%s",aopGet(AOP(left),2,FALSE,FALSE));
+ if (options.model == MODEL_FLAT24)
+ {
+ emitcode("mov", "dpx,%s",aopGet(AOP(left),2,FALSE,FALSE));
+ emitcode("mov","b,%s",aopGet(AOP(left),3,FALSE,FALSE));
+ }
+ else
+ {
+ emitcode("mov","b,%s",aopGet(AOP(left),2,FALSE,FALSE));
+ }
}
}
/* so dptr know contains the address */
else { /* we need to get it byte by byte */
emitcode("mov","dpl,%s",aopGet(AOP(result),0,FALSE,FALSE));
emitcode("mov","dph,%s",aopGet(AOP(result),1,FALSE,FALSE));
+ if (options.model == MODEL_FLAT24)
+ {
+ emitcode("mov", "dpx,%s",aopGet(AOP(result),2,FALSE,FALSE));
+ }
}
}
/* so dptr know contains the address */
else { /* we need to get it byte by byte */
emitcode("mov","dpl,%s",aopGet(AOP(result),0,FALSE,FALSE));
emitcode("mov","dph,%s",aopGet(AOP(result),1,FALSE,FALSE));
- emitcode("mov","b,%s",aopGet(AOP(result),2,FALSE,FALSE));
+ if (options.model == MODEL_FLAT24)
+ {
+ emitcode("mov", "dpx,%s",aopGet(AOP(result),2,FALSE,FALSE));
+ emitcode("mov","b,%s",aopGet(AOP(result),3,FALSE,FALSE));
+ }
+ else
+ {
+ emitcode("mov","b,%s",aopGet(AOP(result),2,FALSE,FALSE));
+ }
}
}
/* so dptr know contains the address */
}
/* the first two bytes are known */
- size = 2;
+ size = GPTRSIZE - 1;
offset = 0 ;
while (size--) {
aopPut(AOP(result),
"got unknown pointer type");
exit(1);
}
- aopPut(AOP(result),l,2);
+ aopPut(AOP(result),l, GPTRSIZE - 1);
goto release ;
}