From: vrokas Date: Sun, 31 Aug 2003 11:51:50 +0000 (+0000) Subject: * src/pic16/main.c: _pic16_genIVT() corrected offsets in the interrupt X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=e4d99b8b3287d6dbf3e511d761701b6dfd95fc36;p=fw%2Fsdcc * src/pic16/main.c: _pic16_genIVT() corrected offsets in the interrupt vector table * src/pic16/pcode.c: fix to disable inserting BANKSEL before instructions that use the _STATUS register git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2865 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 9dce4357..37286e1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-08-31 Vangelis Rokas + * src/pic16/main.c: corrected offsets of interrupt vectors in _pic16_genIVT() + * src/pic16/pcode.c: fix to disable inserting BANKSEL directive + before instructions that use the _STATUS register + 2003-08-31 Bernhard Held * src/mcs51/gen.c (freeAsmop): fixed off by one in stack offset (AOP_STK) diff --git a/src/pic16/main.c b/src/pic16/main.c index 2228b5ec..07545821 100644 --- a/src/pic16/main.c +++ b/src/pic16/main.c @@ -269,29 +269,27 @@ _pic16_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts) #endif #if 0 - if (options.model != MODEL_FLAT24) - { - /* Let the default code handle it. */ - return FALSE; - } + if (options.model != MODEL_FLAT24) { + /* Let the default code handle it. */ + return FALSE; + } #endif /* PIC18F family has only two interrupts, the high and the low - * priority interrupts, which reside in 0x0008 and 0x0018 respectively */ + * priority interrupts, which reside at 0x0008 and 0x0018 respectively - VR */ fprintf(of, "; RESET vector\n"); fprintf(of, "\tgoto\t__sdcc_gsinit_startup\n"); - fprintf(of, "\tres 2\n"); + fprintf(of, "\tres 6\n"); fprintf(of, "; High priority interrupt vector 0x0008\n"); - if(interrupts[1]) { fprintf(of, "\tgoto\t%s\n", interrupts[1]->rname); - fprintf(of, "\tres\t6\n"); + fprintf(of, "\tres\t8\n"); } else { fprintf(of, "\tretfie\n"); - fprintf(of, "\tres\t14\n"); + fprintf(of, "\tres\t8\n"); } fprintf(of, "; Low priority interrupt vector 0x0018\n"); diff --git a/src/pic16/pcode.c b/src/pic16/pcode.c index b4bbe2db..d03ae85c 100644 --- a/src/pic16/pcode.c +++ b/src/pic16/pcode.c @@ -5963,10 +5963,11 @@ static void pic16_FixRegisterBanking(pBlock *pb) } #endif +#warning Fix this if-conditional /* the !(reg->rIdx==-1) is a temporary hack. It should be changed - VR 6-Jun-2003 */ - if( ( (reg && !(reg->rIdx==-1) && !isACCESS_BANK(reg) /*&& REG_BANK(reg)!=cur_bank*/ && !isBankInstruction(pc)) || - ((PCI(pc)->op != POC_CALL) /*&& (cur_bank != 0)*/ ) ) && - (!isPCI_LIT(pc)) ) { + if( ( (reg /*&& !(reg->rIdx==-1)*/ && !isACCESS_BANK(reg) && (isBankInstruction(pc)==-1) && !(reg->alias == 0x80) ) + /*|| (PCI(pc)->op != POC_CALL)*/ ) + && (!isPCI_LIT(pc)) ) { /* Examine the instruction before this one to make sure it is @@ -5978,8 +5979,10 @@ static void pic16_FixRegisterBanking(pBlock *pb) reg_bank = (reg) ? REG_BANK(reg) : 0; -// fprintf(stderr, "%s:%d add bank = %d\n", __FUNCTION__, __LINE__, reg_bank); -// pc->print(stderr, pc); +#if 0 + fprintf(stderr, "%s:%d add bank = %d\n", __FUNCTION__, __LINE__, reg_bank); + pc->print(stderr, pc); +#endif // if (cur_bank != reg_bank) { cur_bank = reg_bank;