* src/pic16/NOTES: moved Vangelis from active developers to people to contact
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 15 Jun 2005 19:50:54 +0000 (19:50 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 15 Jun 2005 19:50:54 +0000 (19:50 +0000)
* device/include/pic16/{6520.h,8520.h}: fixed configuration bits
* src/pic16/gen.c (): prevent iTemps from being considered to be in CODESPACE,
  fixes bug #1221120; for symbols in CODESPACE get number of bytes to read from
  OP_SYM_TYPE() instead of OP_SYM_ETYPE()

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3781 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/include/pic16/pic18f6520.h
device/include/pic16/pic18f8520.h
src/pic16/NOTES
src/pic16/gen.c

index 27015a48722a428944efb28454508400a84b4703..2f8968dc50c6fd84ca63c6fafb2683436ec05e3f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-06-15 Raphael Neider <rneider AT web.de>
+
+       * src/pic16/NOTES: moved Vangelis from active developers to people to contact
+       * device/include/pic16/{6520.h,8520.h}: fixed configuration bits
+       * src/pic16/gen.c (): prevent iTemps from being considered to be in CODESPACE,
+         fixes bug #1221120; for symbols in CODESPACE get number of bytes to read from
+         OP_SYM_TYPE() instead of OP_SYM_ETYPE()
+
 2005-06-06 Frieder Ferlemann <Frieder.Ferlemann AT web.de>
 
        * device/include/mcs51/reg764.h: Changed PB0 to PBO as requested by
index 34661e0765de92b1faffaa3bc5c86b7f4845dd76..f4210a370ac80e743ced69239bdeff51c67c6009 100644 (file)
@@ -1231,8 +1231,8 @@ extern __sfr __at (0xfff) TOSU;
 #define __CONFIG1H     0x300001
 #define __CONFIG2L     0x300002
 #define __CONFIG2H     0x300003
-#define __CONFIG3L     0x300004
 #define __CONFIG3H     0x300005
+#define __CONFIG4L     0x300006
 #define __CONFIG5L     0x300008
 #define __CONFIG5H     0x300009
 #define __CONFIG6L     0x30000A
@@ -1284,28 +1284,21 @@ extern __sfr __at (0xfff) TOSU;
 #define _WDTPS_1_2_2H  0xF3    /* 1:2 */
 #define _WDTPS_1_1_2H  0xF1    /* 1:1 */
 
-/* External Bus Wait 3L options */
-#define _WAIT_OFF_3L   0xFF    /* Disabled */
-#define _WAIT_ON_3L    0x7F    /* Enabled */
-
 /* CCP2 Mux 3H options */
 #define _CCP2MUX_RC1_3H        0xFF    /* RC1 */
-#define _CCP2MUX_RE7_MICROCONTROLLER__RB3_3H   0xFE    /* RE7(Microcontroller)/RB3 */
-
-/* Timer1 OSC 3H options */
-#define _T1OSCMX_LOW_3H        0xFD    /* Low Power */
+#define _CCP2MUX_RE7_3H        0xFE    /* RE7 */
 
-/* Low Voltage Program 3H options */
-#define _LVP_ON_3H     0xFF    /* Enabled */
-#define _LVP_OFF_3H    0xFB    /* Disabled */
+/* Low Voltage Program 4L options */
+#define _LVP_ON_4L     0xFF    /* Enabled */
+#define _LVP_OFF_4L    0xFB    /* Disabled */
 
-/* Background Debug 3H options */
-#define _BACKBUG_OFF_3H        0xFF    /* Disabled */
-#define _BACKBUG_ON_3H 0x7F    /* Enabled */
+/* Background Debug 4L options */
+#define _BACKBUG_OFF_4L        0xFF    /* Disabled */
+#define _BACKBUG_ON_4L 0x7F    /* Enabled */
 
-/* Stack Overflow Reset 3H options */
-#define _STVR_ON_3H    0xFF    /* Enabled */
-#define _STVR_OFF_3H   0xFE    /* Disabled */
+/* Stack Overflow Reset 4L options */
+#define _STVR_ON_4L    0xFF    /* Enabled */
+#define _STVR_OFF_4L   0xFE    /* Disabled */
 
 /* Code Protect 00800-01FFF 5L options */
 #define _CP_0_OFF_5L   0xFF    /* Disabled */
index bef093785572593678245427403d06b4cf42eb64..4cf5c0b792393f4b9d79d7095c4078d064d18e9d 100644 (file)
@@ -1397,17 +1397,17 @@ extern __sfr __at (0xfff) TOSU;
 /* Timer1 OSC 3H options */
 #define _T1OSCMX_LOW_3H        0xFD    /* Low Power */
 
-/* Low Voltage Program 3H options */
-#define _LVP_ON_3H     0xFF    /* Enabled */
-#define _LVP_OFF_3H    0xFB    /* Disabled */
+/* Low Voltage Program 4L options */
+#define _LVP_ON_4L     0xFF    /* Enabled */
+#define _LVP_OFF_4L    0xFB    /* Disabled */
 
-/* Background Debug 3H options */
-#define _BACKBUG_OFF_3H        0xFF    /* Disabled */
-#define _BACKBUG_ON_3H 0x7F    /* Enabled */
+/* Background Debug 4L options */
+#define _BACKBUG_OFF_4L        0xFF    /* Disabled */
+#define _BACKBUG_ON_4L 0x7F    /* Enabled */
 
-/* Stack Overflow Reset 3H options */
-#define _STVR_ON_3H    0xFF    /* Enabled */
-#define _STVR_OFF_3H   0xFE    /* Disabled */
+/* Stack Overflow Reset 4L options */
+#define _STVR_ON_4L    0xFF    /* Enabled */
+#define _STVR_OFF_4L   0xFE    /* Disabled */
 
 /* Code Protect 00800-01FFF 5L options */
 #define _CP_0_OFF_5L   0xFF    /* Disabled */
index 847485e9eef63b1282d07f6455315b2f4404848f..b61b16c90b00f985a2bcd08228a99a928a2c2613 100644 (file)
@@ -1,4 +1,4 @@
-lNOTES file for SDCC pic16 port
+NOTES file for SDCC pic16 port
 $Id$
 
 Current pic16 port status is: Development
@@ -11,10 +11,10 @@ For any questions please ask the current port
 developers.
 
 Current developer:
-Vangelis Rokas <vrokas AT users.sourceforge.net>
 Raphael Neider <rneider AT web.de>
 
 Other people to contact:
+Vangelis Rokas <vrokas AT users.sourceforge.net>
 Scott Dattalo  <scott AT dattalo.com>
 
 ======================================================================
index ba47ce60c4404207aab747de0fcdba1691e3d1b9..f4f84c80183f105d616f1144f95e0b4b03785a73 100644 (file)
@@ -7,6 +7,7 @@
   PIC port   -  Scott Dattalo scott@dattalo.com (2000)
   PIC16 port -  Martin Dubuc m.dubuc@rogers.com (2002)
              -  Vangelis Rokas vrokas@otenet.gr (2003,2004,2005)
+  Bug Fixes  -  Raphael Neider rneider@web.de (2004,2005)
   
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
@@ -5054,7 +5055,7 @@ static void genCmp (operand *left,operand *right,
     left = right;
     right = dummy;
 
-    performedLt ^= 1; // instead of "left < right" we check for "right >= left+1"
+    performedLt ^= 1; // instead of "left < right" we check for "right >= left+1, i.e. "right < left+1"
   } else if (isAOP_LIT(right)) {
     lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
   } // if
@@ -12473,16 +12474,21 @@ static void genAssign (iCode *ic)
   if (AOP_TYPE(right) == AOP_REG) {
     DEBUGpic16_emitcode(";   ", "%s:%d assign from register\n", __FUNCTION__, __LINE__);
     while (size--) {
-      
       pic16_emitpcode (POC_MOVFF, pic16_popGet2(AOP(right), AOP(result), offset++));
     } // while
     goto release;
   }
 
+  /* when do we have to read the program memory?
+   * - if right itself is a symbol in code space
+   *   (we don't care what it points to if it's a pointer)
+   * - AND right is not a function (we would want its address)
+   */
   if(AOP_TYPE(right) != AOP_LIT
-       && IN_CODESPACE(SPEC_OCLS(OP_SYMBOL(right)->etype))
+       && IN_CODESPACE(SPEC_OCLS(OP_SYM_ETYPE(right)))
        && !IS_FUNC(OP_SYM_TYPE(right))
-       ) {
+       && !IS_ITEMP(right))
+  {
        DEBUGpic16_emitcode(";   ", "%s:%d symbol in code space, take special care\n", __FUNCTION__, __LINE__);
        fprintf(stderr, "%s:%d symbol %s = [ %s ] is in code space\n", __FILE__, __LINE__, OP_SYMBOL(result)->name, OP_SYMBOL(right)->name);
 
@@ -12505,7 +12511,8 @@ static void genAssign (iCode *ic)
                                pic16_popCopyReg(&pic16_pc_tblptru)));
        }
 
-       size = min(getSize(OP_SYM_ETYPE(right)), AOP_SIZE(result));
+       /* must fetch 3 bytes for pointers (was OP_SYM_ETYPE before) */
+       size = min(getSize(OP_SYM_TYPE(right)), AOP_SIZE(result));
        while(size--) {
                pic16_emitpcodeNULLop(POC_TBLRD_POSTINC);
                pic16_emitpcode(POC_MOVFF, pic16_popGet2p(pic16_popCopyReg(&pic16_pc_tablat),
@@ -12513,7 +12520,9 @@ static void genAssign (iCode *ic)
                offset++;
        }
 
-       size = getSize(OP_SYM_ETYPE(right));
+       /* FIXME: for pointers we need to extend differently (according
+        * to pointer type DATA/CODE/EEPROM/... :*/
+       size = getSize(OP_SYM_TYPE(right));
        if(AOP_SIZE(result) > size) {
                size = AOP_SIZE(result) - size;
                while(size--) {