/*-----------------------------------------------------------------*/
/* freeAsmop - free up the asmop given to an operand */
-/*----------------------------------------------------------------*/
+/*-----------------------------------------------------------------*/
static void
freeAsmop (operand * op, asmop * aaop, iCode * ic, bool pop)
{
/* pushSide - */
/*-----------------------------------------------------------------*/
static void
-pushSide (operand * oper, int size)
+pushSide (operand * oper, int size, iCode * ic)
{
int offset = 0;
+ int nPushed = _G.r0Pushed + _G.r1Pushed;
+
+ aopOp (oper, ic, FALSE);
+
+ if (nPushed != _G.r0Pushed + _G.r1Pushed)
+ {
+ while (offset < size)
+ {
+ char *l = aopGet (oper, offset, FALSE, TRUE);
+ emitcode ("mov", "%s,%s", fReturn[offset++], l);
+ }
+ freeAsmop (oper, NULL, ic, TRUE);
+ offset = 0;
+ while (offset < size)
+ {
+ emitcode ("push", "%s", fReturn[offset++]);
+ }
+ return;
+ }
+
while (size--)
{
char *l = aopGet (oper, offset++, FALSE, TRUE);
emitcode ("push", "%s", l);
}
}
+
+ freeAsmop (oper, NULL, ic, TRUE);
}
/*-----------------------------------------------------------------*/
emitcode ("push", "acc");
/* now push the calling address */
- aopOp (IC_LEFT (ic), ic, FALSE);
-
- pushSide (IC_LEFT (ic), FPTRSIZE);
-
- freeAsmop (IC_LEFT (ic), NULL, ic, TRUE);
+ pushSide (IC_LEFT (ic), FPTRSIZE, ic);
- /* if send set is not empty the assign */
+ /* if send set is not empty then assign */
if (_G.sendSet)
{
genSend(reverseSet(_G.sendSet));