DEBUGpic16_emitcode ("; ***","%s %d size=%d",__FUNCTION__,__LINE__,size);
- /* load value to write in TBLPTRH:TBLPTRL:PRODH:PRODL */
+
+ /* load value to write in TBLPTRH:TBLPTRL:PRODH:[stack] */
+
+ /* value of right+0 is placed on stack, which will be retrieved
+ * by the support function this restoring the stack. The important
+ * thing is that there is no need to manually restore stack pointer
+ * here */
mov2fp(pic16_popCopyReg(&pic16_pc_gptrreg), AOP(right), 0);
if(size>1)mov2fp(pic16_popCopyReg(&pic16_pc_prodh), AOP(right), 1);
if(size>2)mov2fp(pic16_popCopyReg(&pic16_pc_tblptrl), AOP(right), 2);
strcpy(sym->rname, fgptrput);
checkAddSym(&externs, sym);
+#if 0
sym = newSymbol("__GPTRREG", 0);
strcpy(sym->rname, "__GPTRREG");
checkAddSym(&externs, sym);
+#endif
// fprintf(stderr, "%s:%d adding extern symbol %s in externs\n", __FILE__, __LINE__, fgptrget);
}
pCodeOpReg pic16_pc_wsave = {{PO_GPR_REGISTER, "WSAVE"}, -1, NULL,0,NULL};
pCodeOpReg pic16_pc_ssave = {{PO_GPR_REGISTER, "SSAVE"}, -1, NULL,0,NULL};
-pCodeOpReg pic16_pc_gptrreg = {{PO_GPR_REGISTER, "__GPTRREG"}, -1, NULL,0,NULL};
-
pCodeOpReg pic16_pc_gpsimio = {{PO_GPR_REGISTER, "GPSIMIO"}, -1, NULL, 0, NULL};
pCodeOpReg pic16_pc_gpsimio2 = {{PO_GPR_REGISTER, "GPSIMIO2"}, -1, NULL, 0, NULL};
pic16_pc_gpsimio.rIdx = IDX_GPSIMIO;
pic16_pc_gpsimio2.rIdx = IDX_GPSIMIO2;
- pic16_pc_gptrreg.r = newReg(REG_SFR, PO_GPR_REGISTER, 0, "__GPTRREG", 1, 0x40, NULL); //PO_GPR_REGISTER, 0x00);
- pic16_pc_gptrreg.rIdx = 0;
-
/* probably should put this in a separate initialization routine */
pb_dead_pcodes = newpBlock();
extern pCodeOpReg pic16_pc_gpsimio;
extern pCodeOpReg pic16_pc_gpsimio2;
-extern pCodeOpReg pic16_pc_gptrreg;
#endif // __PCODE_H__