From: vrokas Date: Sun, 10 Oct 2004 21:02:46 +0000 (+0000) Subject: * minor corrections between previous commit X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=cbf9b46defd407d71c17676bcf34e7f1b29c2389;p=fw%2Fsdcc * minor corrections between previous commit git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3529 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/pic16/gen.c b/src/pic16/gen.c index efc10964..58d02e0a 100644 --- a/src/pic16/gen.c +++ b/src/pic16/gen.c @@ -10920,7 +10920,13 @@ static void genGenPointerSet (operand *right, 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); @@ -10954,9 +10960,11 @@ static void genGenPointerSet (operand *right, 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); } diff --git a/src/pic16/pcode.c b/src/pic16/pcode.c index f3e9ca0e..f520ff06 100644 --- a/src/pic16/pcode.c +++ b/src/pic16/pcode.c @@ -112,8 +112,6 @@ pCodeOpReg pic16_pc_kzero = {{PO_GPR_REGISTER, "KZ"}, -1, NULL,0,NULL}; 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}; @@ -2954,9 +2952,6 @@ void pic16_pCodeInitRegisters(void) 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(); diff --git a/src/pic16/pcode.h b/src/pic16/pcode.h index 7059deae..55ae2e9e 100644 --- a/src/pic16/pcode.h +++ b/src/pic16/pcode.h @@ -1051,6 +1051,5 @@ extern pCodeOpReg pic16_pc_ssave; /* registers during an interrupt */ extern pCodeOpReg pic16_pc_gpsimio; extern pCodeOpReg pic16_pc_gpsimio2; -extern pCodeOpReg pic16_pc_gptrreg; #endif // __PCODE_H__