+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
#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
#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 */
/* 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 */
-lNOTES file for SDCC pic16 port
+NOTES file for SDCC pic16 port
$Id$
Current pic16 port status is: Development
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>
======================================================================
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
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
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);
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),
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--) {