From: tecodev Date: Wed, 15 Jun 2005 19:50:54 +0000 (+0000) Subject: * src/pic16/NOTES: moved Vangelis from active developers to people to contact X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=bf67f8d705935961d3758f9735e5f528141a47be;p=fw%2Fsdcc * 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() git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3781 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 27015a48..2f8968dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-06-15 Raphael Neider + + * 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 * device/include/mcs51/reg764.h: Changed PB0 to PBO as requested by diff --git a/device/include/pic16/pic18f6520.h b/device/include/pic16/pic18f6520.h index 34661e07..f4210a37 100644 --- a/device/include/pic16/pic18f6520.h +++ b/device/include/pic16/pic18f6520.h @@ -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 */ diff --git a/device/include/pic16/pic18f8520.h b/device/include/pic16/pic18f8520.h index bef09378..4cf5c0b7 100644 --- a/device/include/pic16/pic18f8520.h +++ b/device/include/pic16/pic18f8520.h @@ -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 */ diff --git a/src/pic16/NOTES b/src/pic16/NOTES index 847485e9..b61b16c9 100644 --- a/src/pic16/NOTES +++ b/src/pic16/NOTES @@ -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 Raphael Neider Other people to contact: +Vangelis Rokas Scott Dattalo ====================================================================== diff --git a/src/pic16/gen.c b/src/pic16/gen.c index ba47ce60..f4f84c80 100644 --- a/src/pic16/gen.c +++ b/src/pic16/gen.c @@ -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--) {