- mov2w (AOP(IC_LEFT(sic)), offset);
- offset++;
- }
- pic16_freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
- }
- _G.sendSet = NULL;
- }
-
- pic16_aopOp(IC_LEFT(ic),ic,FALSE);
-
- // push return address
- // push $ on return stack, then replace with retlbl
-
- pic16_emitpcodeNULLop(POC_PUSH);
-
- pic16_emitpcode(POC_MOVLW, pic16_popGetImmd(pcop_lbl->name, 0, 0));
- pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_tosl));
- pic16_emitpcode(POC_MOVLW, pic16_popGetImmd(pcop_lbl->name, 1, 0));
- pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_tosh));
- pic16_emitpcode(POC_MOVLW, pic16_popGetImmd(pcop_lbl->name, 2, 0));
- pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_tosu));
-
- /* make the call by writing the pointer into pc */
- pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(IC_LEFT(ic)),2), pic16_popCopyReg(&pic16_pc_pclatu)));
- pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popGet(AOP(IC_LEFT(ic)),1), pic16_popCopyReg(&pic16_pc_pclath)));
-
- // note: MOVFF to PCL not allowed
- pic16_emitpcode(POC_MOVFW, pic16_popGet(AOP(IC_LEFT(ic)),0));
- pic16_emitpcode(POC_MOVWF, pic16_popCopyReg(&pic16_pc_pcl));
-
-
-// pic16_emitpcode(POC_GOTO, pic16_popGetLabel(retlbl->key));
-// pic16_emitpcodeNULLop(POC_NOP);
-// pic16_emitpcodeNULLop(POC_NOP);
-
- /* return address is here: (X) */
- pic16_emitpLabelFORCE(retlbl->key);
-
-// pic16_emitpcodeNULLop(POC_NOP);
-
- pic16_freeAsmop (IC_LEFT(ic),NULL,ic,TRUE);
-
- GpsuedoStkPtr=0;
- /* if we need assign a result value */
- if ((IS_ITEMP(IC_RESULT(ic)) &&
- (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
- OP_SYMBOL(IC_RESULT(ic))->spildir )) ||
- IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
-
- _G.accInUse++;
- pic16_aopOp(IC_RESULT(ic),ic,FALSE);
- _G.accInUse--;
-
- assignResultValue(IC_RESULT(ic), 1);
-
- DEBUGpic16_emitcode ("; ","%d left %s",__LINE__,
- pic16_AopType(AOP_TYPE(IC_RESULT(ic))));
-
- pic16_freeAsmop(IC_RESULT(ic),NULL, ic,TRUE);
- }
-
- if(stackParms>0) {
- pic16_emitpcode(POC_MOVLW, pic16_popGetLit(stackParms));
- pic16_emitpcode(POC_ADDWF, pic16_popCopyReg( &pic16_pc_fsr1l ));
- if(STACK_MODEL_LARGE) {
- emitSKPNC;
- pic16_emitpcode(POC_INCF, pic16_popCopyReg( &pic16_pc_fsr1h ));
- }
- }
-
- /* adjust the stack for parameters if required */
-// fprintf(stderr, "%s:%d: %s ic->parmBytes= %d\n", __FILE__, __LINE__, OP_SYMBOL(IC_LEFT(ic))->name, ic->parmBytes);
-
- if (ic->parmBytes) {
- int i;
-
- if (ic->parmBytes > 3) {
- pic16_emitcode("mov","a,%s",spname);
- pic16_emitcode("add","a,#0x%02x", (- ic->parmBytes) & 0xff);
- pic16_emitcode("mov","%s,a",spname);
- } else
- for ( i = 0 ; i < ic->parmBytes ;i++)
- pic16_emitcode("dec","%s",spname);
- }
-
- /* if register bank was saved then pop them */
- if (ic->bankSaved)
- unsaverbank(FUNC_REGBANK(dtype),ic,TRUE);
-
- /* if we hade saved some registers then unsave them */
- if (ic->regsSaved && !IFFUNC_CALLEESAVES(dtype))
- unsaveRegisters (ic);
-}
-
-
-#if 0 // patch 14
-// old version, kept for reference
-
-/*-----------------------------------------------------------------*/
-/* genPcall - generates a call by pointer statement */
-/*-----------------------------------------------------------------*/
-static void genPcall (iCode *ic)
-{
- sym_link *dtype;
- symbol *rlbl = newiTempLabel(NULL);