* src/pic16/main.c: _pic16_genIVT() corrected offsets in the interrupt
authorvrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 31 Aug 2003 11:51:50 +0000 (11:51 +0000)
committervrokas <vrokas@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 31 Aug 2003 11:51:50 +0000 (11:51 +0000)
  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

ChangeLog
src/pic16/main.c
src/pic16/pcode.c

index 9dce4357d9b18cbadfd2cf98a91b84bd3ffaee3a..37286e1e20d38d9cda938bd955dd08e865975c48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-31  Vangelis Rokas <vrokas@otenet.gr>
+       * 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 <bernhard@bernhardheld.de>
 
        * src/mcs51/gen.c (freeAsmop): fixed off by one in stack offset (AOP_STK)
index 2228b5ec50298dfda979a7f1ecffebcdd08e2477..075458212ea490b5ff871d675796eaa11a023a72 100644 (file)
@@ -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");
index b4bbe2db6cb7e215e10bcd66a3e20429c979eecb..d03ae85c11acd5c3b6d81e66ed82b7aa6a7b3ba8 100644 (file)
@@ -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;