}
/* if already has a asmop then continue */
- if (op->aop && aop->size == getSize(sym->type))
+ if (op->aop )
return;
/* if the underlying symbol has a aop */
}
/* else spill location */
+ if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) {
+ /* force a new aop if sizes differ */
+ sym->usl.spillLoc->aop = NULL;
+ }
sym->aop = op->aop = aop =
aopForSym (ic, sym->usl.spillLoc, result);
aop->size = getSize (sym->type);
the same register bank then we need to save the
destination registers on the stack */
dtype = operandType (IC_LEFT (ic));
- if (dtype && !IFFUNC_ISNAKED(dtype) &&
+ if (currFunc && dtype && !IFFUNC_ISNAKED(dtype) &&
(FUNC_REGBANK (currFunc->type) != FUNC_REGBANK (dtype)) &&
IFFUNC_ISISR (currFunc->type))
{
the same register bank then we need to save the
destination registers on the stack */
dtype = operandType (IC_LEFT (ic));
- if (dtype && !FUNC_ISNAKED(dtype) &&
+ if (currFunc && dtype && !FUNC_ISNAKED(dtype) &&
IFFUNC_ISISR (currFunc->type) &&
(FUNC_REGBANK (currFunc->type) != FUNC_REGBANK (dtype))) {
saveRBank (FUNC_REGBANK (dtype), ic, TRUE);
emitcode ("add", "a,#0x%02x", ((char) sym->stack & 0xff));
emitcode ("mov", "sp,a");
+ }
+ else if (i > 5)
+ {
+
+ /* ISRs will be handled by the code above, because they
+ can't have parameters. Therefore it's save to use r0 */
+ emitcode ("mov", "r0,a");
+ emitcode ("mov", "a,sp");
+ emitcode ("add", "a,#0x%02x", ((char) sym->stack & 0xff));
+ emitcode ("mov", "sp,a");
+ emitcode ("mov", "a,r0");
+
}
else
while (i--)
emitcode ("setb", "ea");
/* if debug then send end of function */
- /* if (options.debug && currFunc) */
if (options.debug && currFunc)
{
_G.debugLine = 1;
if (allocInfo)
printAllocInfo (currFunc, codeOutFile);
/* if debug information required */
- /* if (options.debug && currFunc) { */
if (options.debug && currFunc)
{
cdbSymbol (currFunc, cdbFile, FALSE, TRUE);