+2008-03-30 Philipp Klaus Krause <pkk AT spth.de>
+ * src/z80/gen.c (assignResultValue):
+ Reverted reversal of order of bytewise return value assignments introduced in last commit.
+
2008-03-30 Philipp Klaus Krause <pkk AT spth.de>
* src/z80/gen.c (emitDebug, assignResultValue, genPlus, genMinus, genMult, genJumpTab):
Use 16-bit instructions for addition in some additional cases,
assignResultValue (operand * oper)
{
int size = AOP_SIZE (oper);
- int i;
bool topInA = 0;
wassertl (size <= 4, "Got a result that is bigger than four bytes");
else
{
if ((AOP_TYPE (oper) == AOP_REG) && (AOP_SIZE (oper) == 4) &&
- !strcmp (AOP (oper)->aopu.aop_reg[size-2]->name, _fReturn[size-1]))
+ !strcmp (AOP (oper)->aopu.aop_reg[size-1]->name, _fReturn[size-2]))
{
size--;
_emitMove ("a", _fReturn[size-1]);
aopPut (AOP (oper), _fReturn[size], size-1);
size--;
}
- for (i = 0; i < size; i++)
+ while(size--)
{
- aopPut (AOP (oper), _fReturn[i], i);
+ aopPut (AOP (oper), _fReturn[size], size);
}
}
}
emit2 ("!enterxl", sym->stack);
else if (sym->stack)
{
- if (optimize.codeSize && sym->stack <= 8 || sym->stack <= 4)
+ if ((optimize.codeSize && sym->stack <= 8) || sym->stack <= 4)
{
int stack = sym->stack;
emit2 ("!enter");