* src/pic16/devices.inc,
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 29 Apr 2008 17:00:17 +0000 (17:00 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 29 Apr 2008 17:00:17 +0000 (17:00 +0000)
  device/include/pic16/pic16devices.txt: replaced compiled-in list
  of devices with a variant parsed at runtime
* src/pic16/device.c: added support for parsing pic16devices.txt,
  clean up
* src/pic16/device.h: removed (now) unused fields from PIC_device
* src/pic16/main.c: removed #pragma maxram,
  (_pic16_initPaths): removed bogus generation of search paths,
  setup the port proper only after the search paths (for
  pic16devices.txt) are set up,
  (_pic16_finaliseOptions): moved processor dependant code here
  from _pic16_initPaths(), clean up
* src/pic16/ralloc.c (pic16_init_stack),
* src/pic16/ralloc.h,
* src/pic16/pcode.c: clean up
* device/include/Makefile.in,
  support/scripts/sdcc.nsi: also install/package pic16devices.txt
* support/scripts/inc2h-pic16.pl: updated instructions

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

12 files changed:
ChangeLog
device/include/Makefile.in
device/include/pic16/pic16devices.txt [new file with mode: 0644]
src/pic16/device.c
src/pic16/device.h
src/pic16/devices.inc [deleted file]
src/pic16/main.c
src/pic16/pcode.c
src/pic16/ralloc.c
src/pic16/ralloc.h
support/scripts/inc2h-pic16.pl
support/scripts/sdcc.nsi

index ed7c58b80e698b3f207226f092e89ce19946e0dc..8638a69e0d026094e1cddc1a748ad17511f1dc96 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2008-04-29 Raphael Neider <rneider AT web.de>
+
+       * src/pic16/devices.inc,
+         device/include/pic16/pic16devices.txt: replaced compiled-in list
+         of devices with a variant parsed at runtime
+       * src/pic16/device.c: added support for parsing pic16devices.txt,
+         clean up
+       * src/pic16/device.h: removed (now) unused fields from PIC_device
+       * src/pic16/main.c: removed #pragma maxram,
+         (_pic16_initPaths): removed bogus generation of search paths,
+         setup the port proper only after the search paths (for
+         pic16devices.txt) are set up,
+         (_pic16_finaliseOptions): moved processor dependant code here
+         from _pic16_initPaths(), clean up
+       * src/pic16/ralloc.c (pic16_init_stack),
+       * src/pic16/ralloc.h,
+       * src/pic16/pcode.c: clean up
+       * device/include/Makefile.in,
+         support/scripts/sdcc.nsi: also install/package pic16devices.txt
+       * support/scripts/inc2h-pic16.pl: updated instructions
+
 2008-04-29 Raphael Neider <rneider AT web.de>
 
        * device/include/pic16/{pic18f2480.h, pic18f2580.h, pic18f4423.h,
index 7226ee75d00ae855f31423a7ccab898865bd9cc5..89ec426d2cfbd25979627a6565119614bd9d713d 100644 (file)
@@ -55,6 +55,7 @@ install: all installdirs
        fi
        if [ "`grep pic16 $(top_builddir)/ports.build`" = pic16 ]; then \
                $(CP) $(srcdir)/pic16/*.h $(sdcc_includedir)/pic16 ; \
+               $(CP) $(srcdir)/pic16/*.txt $(sdcc_includedir)/pic16 ; \
        fi
        if [ "`grep z80 $(top_builddir)/ports.build`" = z80 ]; then \
                $(CP) $(srcdir)/z80/*.h $(sdcc_includedir)/z80 ; \
diff --git a/device/include/pic16/pic16devices.txt b/device/include/pic16/pic16devices.txt
new file mode 100644 (file)
index 0000000..5e8885a
--- /dev/null
@@ -0,0 +1,546 @@
+#
+# Specification of devices supported by the PIC16 target of the
+# Small Devices C Compiler (SDCC).
+#
+# Lines starting with a hash '#' are ignored.
+# A new device specification must begin with a 'name' command.
+# Numbers can be given in any way acceptable for scanf's %d,
+# i.e., octal (0[0-7]*), decimal ([1-9][0-9]*), or hexadecimal
+# (0[xX][0-9a-fA-F]+).
+# Strings must not be quoted and may not contain whitespace!
+#
+# Valid commands are:
+# name <name>
+#       Begin specification of device type <name>, e.g. 18f6720.
+#       Aliases 'p<name>' and 'pic<name>' will be recognized as well.
+# using <name>
+#       Import specification from the named entry, which must be defined
+#       earlier. Later commands overrule imported ones.
+# ramsize <size>
+#       This device has <size> bytes of RAM.
+# split <offset>
+#       Addresses below <offset> refer to bank 0, addresses above <offset>
+#       refer to SFRs in bank 15 for references via the access bank.
+# sfrrange <first> <last>
+#       SFRs occupy addresses <first> to <last> (both included) and must
+#       hence not be used as RAM.
+# configrange <first> <last>
+#       Configuration registers occupy addresses <first> to <last> (both
+#       included).
+# configword <address> <mask> <value>
+#       The config word at address <address> only implements the bits
+#       indicated via <mask> (all others will be forced to 0 by the
+#       compiler).
+#       Unless overridden in C code, use the given default <value>.
+# idlocrange <first> <last>
+#       ID locations occupy addresses <first> to <last> (both included).
+# idword <address> <value>
+#       Unless overridden in C code, use the given default <value>.
+#
+
+name        18f1220
+ramsize     256
+split       0x80
+sfrrange    0xf80 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0xff
+configword  0x300002 0x0f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x80 0xff
+configword  0x300006 0x85 0xff
+configword  0x300008 0x03 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x03 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x03 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f1320
+using       18f1220
+
+
+name        18f2220
+ramsize     512
+split       0x80
+sfrrange    0xf80 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0xff
+configword  0x300002 0x0f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x83 0xff
+configword  0x300006 0x85 0xff
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f2221
+ramsize     512
+split       0x80
+sfrrange    0xf80 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0x37
+configword  0x300002 0x1f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x87 0xfb
+configword  0x300006 0xf5 0x8f
+configword  0x300008 0x03 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x03 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x03 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f2320
+using       18f2220
+
+
+name        18f2321
+using       18f2221
+
+
+name        18f2331
+ramsize     768
+split       0x60
+sfrrange    0xf60 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0xff
+configword  0x300002 0x0f 0xff
+configword  0x300003 0x3f 0xff
+configword  0x300004 0x3c 0xff
+configword  0x300005 0x9d 0xff
+configword  0x300006 0x85 0xff
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f242
+ramsize     768
+split       0x80
+sfrrange    0xf80 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0x27 0xff
+configword  0x300002 0x0f 0xff
+configword  0x300003 0x0f 0xff
+configword  0x300005 0x01 0xff
+configword  0x300006 0x85 0xff
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f2420
+ramsize     768
+split       0x80
+sfrrange    0xf80 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0x07
+configword  0x300002 0x1f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x87 0xfb
+configword  0x300006 0xc5 0xbf
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f2423
+ramsize     768
+split       0x80
+sfrrange    0xf80 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0x07
+configword  0x300002 0x1f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x87 0xfb
+configword  0x300006 0xc5 0xbf
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f2431
+using       18f2331
+
+
+name        18f2455
+ramsize     2048
+split       0x60
+sfrrange    0xf60 0xfff
+configrange 0x300000 0x30000d
+configword  0x300000 0x3f 0xc0
+configword  0x300001 0xcf 0x35
+configword  0x300002 0x3f 0xdf
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x87 0xfb
+configword  0x300006 0xe5 0x9f
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f248
+ramsize     768
+split       0x60
+sfrrange    0xf00 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0x27 0xff
+configword  0x300002 0x0f 0xff
+configword  0x300003 0x0f 0xff
+configword  0x300006 0x85 0xff
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f2480
+ramsize     768
+split       0x60
+sfrrange    0xd00 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0x37
+configword  0x300002 0x1f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x86 0xfb
+configword  0x300006 0xd5 0xaf
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f24j10
+ramsize     1024
+split       0x80
+sfrrange    0xf80 0xfff
+configrange 0x300000 0x300005
+configword  0x300000 0xe1 0xff
+configword  0x300001 0x04 0xf7
+configword  0x300002 0xc7 0xff
+configword  0x300003 0x0f 0xff
+configword  0x300005 0x01 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f252
+using       18f242
+ramsize     1536
+
+
+name        18f2520
+using       18f2420
+ramsize     1536
+
+
+name        18f2523
+using       18f2423
+ramsize     1536
+
+
+name        18f2525
+ramsize     4096
+split       0x80
+sfrrange    0xf80 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0x37
+configword  0x300002 0x1f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x87 0xfb
+configword  0x300006 0xc5 0xbf
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f2550
+using       18f2455
+
+
+name        18f258
+using       18f248
+ramsize     1536
+
+
+name        18f2580
+using       18f2480
+ramsize     1536
+
+
+name        18f2585
+ramsize     4096
+split       0x60
+sfrrange    0xd00 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0x37
+configword  0x300002 0x1f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x86 0xfb
+configword  0x300006 0xf5 0x8f
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f25j10
+using       18f24j10
+
+
+name        18f2620
+using       18f2525
+
+
+name        18f2680
+using       18f2585
+
+
+name        18f2682
+ramsize     4096
+split       0x60
+sfrrange    0xd00 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0xcf 0x37
+configword  0x300002 0x1f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300005 0x86 0xfb
+configword  0x300006 0xf5 0x8f
+configword  0x300008 0x3f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x3f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x3f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f2685
+using       18f2682
+
+
+name        18f4220
+using       18f2220
+
+
+name        18f4221
+using       18f2221
+
+
+name        18f4320
+using       18f2220
+
+
+name        18f4321
+using       18f2221
+
+
+name        18f4331
+using       18f2331
+
+
+name        18f442
+using       18f242
+
+
+name        18f4420
+using       18f2420
+
+
+name        18f4423
+using       18f2423
+
+
+name        18f4431
+using       18f2331
+
+
+name        18f4455
+using       18f2455
+
+
+name        18f448
+using       18f248
+
+
+name        18f4480
+using       18f2480
+
+
+name        18f44j10
+using       18f24j10
+
+
+name        18f452
+using       18f242
+ramsize     1536
+
+
+name        18f4520
+using       18f2420
+ramsize     1536
+
+
+name        18f4523
+using       18f2423
+ramsize     1536
+
+name        18f4525
+using       18f2525
+
+
+name        18f4550
+using       18f2455
+
+
+name        18f458
+using       18f248
+ramsize     1536
+
+
+name        18f4580
+using       18f2480
+ramsize     1536
+
+
+name        18f4585
+using       18f2585
+
+
+name        18f45j10
+using       18f24j10
+
+
+name        18f4620
+using       18f2525
+
+
+name        18f4680
+using       18f2585
+
+
+name        18f4682
+using       18f2682
+
+
+name        18f4685
+using       18f2682
+
+
+name        18f6520
+ramsize     2048
+split       0x60
+sfrrange    0xf60 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0x27 0xff
+configword  0x300002 0x0f 0xff
+configword  0x300003 0x0f 0xff
+configword  0x300004 0x83 0xff
+configword  0x300005 0x03 0xff
+configword  0x300006 0x85 0xff
+configword  0x300008 0xff 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0xff 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0xff 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f6585
+ramsize     3328
+split       0x60
+sfrrange    0xd00 0xfff
+configrange 0x300001 0x30000d
+configword  0x300001 0x2f 0xff
+configword  0x300002 0x0f 0xff
+configword  0x300003 0x1f 0xff
+configword  0x300004 0x83 0xff
+configword  0x300005 0x83 0xff
+configword  0x300006 0x85 0xff
+configword  0x300008 0x0f 0xff
+configword  0x300009 0xc0 0xff
+configword  0x30000a 0x0f 0xff
+configword  0x30000b 0xe0 0xff
+configword  0x30000c 0x0f 0xff
+configword  0x30000d 0x40 0xff
+idlocrange  0x200000 0x200007
+
+
+name        18f6620
+using       18f6520
+ramsize     3840
+
+
+name        18f6680
+using       18f6585
+
+
+name        18f6720
+using       18f6520
+ramsize     3840
+
+
+name        18f8520
+using       18f6520
+
+
+name        18f8585
+using       18f6585
+
+
+name        18f8620
+using       18f6520
+ramsize     3840
+
+
+name        18f8680
+using       18f6585
+
+
+name        18f8720
+using       18f6520
+ramsize     3840
+
+
index 8878ed0799935e17bef44c6935179b32d819da93..84ef0ea4e4c1ac86cb079b7232d3e9d0e8d27ac5 100644 (file)
 #include "ralloc.h"
 #include "device.h"
 
-
-static PIC16_device Pics16[] = {
-/* Device descriptions are now generated by scripts.
- * For simplicities sake we just include them here.
- * Manual overrides may be inserted on top of devices.inc
- * or right here BEFORE inclusion of devices.inc. */
-#include "devices.inc"
-};
-
-static int num_of_supported_PICS = sizeof(Pics16)/sizeof(PIC16_device);
-
 stats_t statistics = { 0, 0, 0, 0 };
 
-#define DEFAULT_PIC "452"
+#define DEVICE_FILE_NAME    "pic16devices.txt"
+
+static PIC16_device default_device = {
+    { "p18f452", "18f452", "pic18f452", "f452" },
+    0x600,
+    0x80,
+    { 0xf80, 0xfff },
+    { /* configuration words */
+      0x300001, 0x30000d,
+      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ ,
+        { 0x0f, 0, 0xff } /* 3 */ , {  -1 , 0, 0xff } /* 4 */ ,
+        { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ ,
+        {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ ,
+        { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ ,
+        { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
+        { 0x40, 0, 0xff } /* d */ }
+    },
+    { /* ID locations */
+      0x200000, 0x200007,
+      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
+        { 0, 0 }, { 0, 0 }, { 0, 0 } }
+    },
+    NULL
+};
 
-PIC16_device *pic16=NULL;
-unsigned int stackPos = 0;
-unsigned int stackLen = 0;
+PIC16_device *pic16 = &default_device;
+static PIC16_device *devices = NULL;
 
-void pic16_setMaxRAM(int size)
-{
-       pic16->maxRAMaddress = size;
-       stackPos = pic16->RAMsize-1;
-
-       if (pic16->maxRAMaddress < 0) {
-               fprintf(stderr, "invalid \"#pragma maxram 0x%x\" setting\n",
-                       pic16->maxRAMaddress);
-         return;
-       }
-}
+extern set *includeDirsSet;
+extern set *userIncDirsSet;
 
 extern char *iComments2;
 
@@ -369,126 +371,382 @@ void pic16_dump_int_registers(FILE *of, set *section)
        Safe_free(rlist);
 }
 
-
-#ifdef WORDS_BIGENDIAN
-  #define _ENDIAN(x)  (3-x)
-#else
-  #define _ENDIAN(x)  (x)
-#endif
-
-
-/*-----------------------------------------------------------------*
- *  void pic16_list_valid_pics(int ncols, int list_alias)
- *
- * Print out a formatted list of valid PIC devices
+/**
+ * Find the device structure for the named device.
+ * Consider usind pic16_find_device() instead!
  *
- * ncols - number of columns in the list.
- *
- * list_alias - if non-zero, print all of the supported aliases
- *              for a device (e.g. F84, 16F84, etc...)
- *-----------------------------------------------------------------*/
-void pic16_list_valid_pics(int ncols, int list_alias)
+ * @param   name
+ *      a name for the desired device
+ * @param   head
+ *      a pointer to the head of the list of devices
+ * @return
+ *      a pointer to the structure for the desired
+ *      device, or NULL
+ */
+static PIC16_device *
+find_in_list(const char *name, PIC16_device *head)
 {
-  int col,longest;
-  int i,j,k,l;
-
-  if(list_alias)
-    list_alias = sizeof(Pics16[0].name) / sizeof(Pics16[0].name[0]);
-
-  /* decrement the column number if it's greater than zero */
-  ncols = (ncols > 1) ? ncols-1 : 4;
-
-  /* Find the device with the longest name */
-  for(i=0,longest=0; i<num_of_supported_PICS; i++) {
-    for(j=0; j<=list_alias; j++) {
-      k = strlen(Pics16[i].name[j]);
-      if(k>longest)
-       longest = k;
-    }
-  }
+    int i;
 
-  col = 0;
+    while (head) {
+        for (i = 0; i < 4; i++) {
+            if (0 == strcmp(head->name[i], name)) {
+                return (head);
+            } // if
+        } // for
 
-  for(i=0;  i < num_of_supported_PICS; i++) {
-    j = 0;
-    do {
-
-      fprintf(stderr,"%s", Pics16[i].name[j]);
-      if(col<ncols) {
-       l = longest + 2 - strlen(Pics16[i].name[j]);
-       for(k=0; k<l; k++)
-         fputc(' ',stderr);
-
-       col++;
-
-      } else {
-       fputc('\n',stderr);
-       col = 0;
-      }
-
-    } while(++j<list_alias);
-
-  }
-  if(col != ncols)
-    fputc('\n',stderr);
+        head = head->next;
+    } // while
 
+    return (NULL);
 }
 
-/*-----------------------------------------------------------------*
- *  
- *-----------------------------------------------------------------*/
-PIC16_device *pic16_find_device(char *name)
+/**
+ * Print a list of supported devices.
+ * If --verbose was given, also emit key characteristics (memory size,
+ * access bank split point, address range of SFRs and config words).
+ *
+ * @param   head
+ *      a pointer to the head of the list of devices
+ */
+static void
+pic16_list_devices(PIC16_device *head)
 {
-
-  int i,j;
-
-  if(!name)
-    return NULL;
-
-  for(i = 0; i<num_of_supported_PICS; i++) {
-
-    for(j=0; j<PROCESSOR_NAMES; j++)
-      if(!STRCASECMP(Pics16[i].name[j], name) )
-       return &Pics16[i];
-  }
-
-  /* not found */
-  return NULL; 
+    int i = 0;
+
+    if (options.verbose) {
+        printf("device        RAM  split        SFRs           config words\n");
+    } // if
+    while (head) {
+        printf("%-10s  ", head->name[0]);
+        if (options.verbose) {
+            printf("%5d   0x%02x    0x%03x..0x%03x    0x%06x..0x%06x\n",
+                    head->RAMsize,
+                    head->acsSplitOfs,
+                    head->sfrRange.sfrLoAddr,
+                    head->sfrRange.sfrHiAddr,
+                    head->cwInfo.confAddrStart,
+                    head->cwInfo.confAddrEnd);
+        } else {
+            i++;
+            if (0 == (i % 6)) {
+                printf("\n");
+            } // if
+        } // if
+        head = head->next;
+    } // while
+    printf("\n");
 }
 
-/*-----------------------------------------------------------------*
- *  
- *-----------------------------------------------------------------*/
-void pic16_init_pic(char *pic_type)
+/**
+ * Read a single line from the given file.
+ * The caller should free() the returned value!
+ *
+ * @param   file
+ *      a pointer to the open file to read
+ * @return
+ *      a pointer to a malloc'ed copy of the (next) line, or NULL
+ */
+static char *
+get_line (FILE *file)
 {
-       pic16 = pic16_find_device(pic_type);
-
-       if(!pic16) {
-               if(pic_type)
-                       fprintf(stderr, "'%s' was not found.\n", pic_type);
-               else
-                       fprintf(stderr, "No processor has been specified (use -pPROCESSOR_NAME)\n");
-
-               fprintf(stderr,"Valid devices are:\n");
+    char *line = NULL;
+    size_t len = 129;
+    size_t done = 0;
+    size_t got = 0;
+
+    while (!feof(file)) {
+        line = (char *) Safe_realloc(line, len);
+        got += fread(&line[done], 1, 128, file);
+        line[got] = 0;
+
+        /* find EOL */
+        while (done < got) {
+            if (('\r' == line[done]) || ('\n' == line[done])) {
+                line[done] = 0;
+                fseek(file, done + 1 - got, SEEK_CUR);
+                return (line);
+            } // if
+            done++;
+        } // while
+
+        len += 128;
+    } // while
+
+    return (line);
+}
 
-               pic16_list_valid_pics(4,0);
-               exit(1);
-       }
+/**
+ * Truncate the given string in place (!) at the first '#' character (if any).
+ *
+ * @param   line
+ *      a pointer to the string to truncate
+ * @return
+ *      a pointer to the truncated string (i.e., line)
+ */
+static char *
+strip_comment (char *line)
+{
+    char *l = line;
+    char c;
+
+    if (!line) {
+        return (line);
+    } // if
+
+    while (0 != (c = *l)) {
+        if ('#' == c) {
+            *l = 0;
+            return (line);
+        } // if
+        l++;
+    } // while
+
+    return (line);
+}
 
-//     printf("PIC processor found and initialized: %s\n", pic_type);
-       pic16_setMaxRAM( 0xfff  );
+/**
+ * Report errors in the device specification.
+ *
+ * @param   msg
+ *      a pointer to the detailed message
+ */
+#define SYNTAX(msg) do {                                \
+    fprintf(stderr, "%s:%d: Syntax error: %s\n",        \
+            DEVICE_FILE_NAME, lineno, msg);             \
+} while (0)
+
+/**
+ * Locate and read in the device specification (if required) and
+ * return the device structure for the named device.
+ *
+ * @param   name
+ *      a pointer to the name of the desired device
+ * @return
+ *      a pointer to the device structure, or NULL
+ */
+static PIC16_device *
+pic16_find_device(const char *name)
+{
+    const char *path;
+    char buffer[PATH_MAX];
+    char *line, *key;
+    const char *sep = " \t\n\r";
+    FILE *f = NULL;
+    PIC16_device *d = NULL, *template;
+    PIC16_device *head = NULL, *tail = NULL;
+    set *_sets[] = { userIncDirsSet, includeDirsSet };
+    set **sets = &_sets[0];
+    int lineno = 0;
+    int res, i;
+    int val[3];
+
+    if (!devices) {
+        //printf("%s: searching %s\n", __func__, DEVICE_FILE_NAME);
+
+        // locate the specification file in the include search paths
+        for (i = 0; (NULL == f) && (i < 2); i++) {
+            for (path = setFirstItem(sets[i]);
+                    (NULL == f) && path;
+                    path = setNextItem(sets[i]))
+            {
+                SNPRINTF(&buffer[0], PATH_MAX, "%s%s%s",
+                        path, DIR_SEPARATOR_STRING, DEVICE_FILE_NAME);
+                //printf("%s: checking %s\n", __func__, &buffer[0]);
+                f = fopen(&buffer[0], "r");
+            } // for
+        } // while
+    } // if
+
+    if (devices) {
+        // list already set up, nothing to do
+    } else if (NULL == f) {
+        fprintf(stderr, "ERROR: device list %s not found, specify its path via -I<path>\n", DEVICE_FILE_NAME);
+        d = &default_device;
+    } else {
+        // parse the specification file and construct a linked list of
+        // supported devices
+        d = NULL;
+        while (NULL != (line = get_line(f))) {
+            strip_comment(line);
+            //printf("%s: read %s\n", __func__, line);
+            lineno++;
+            key = strtok(line, sep);
+            if (!key) {
+                // empty line---ignore
+            } else if (0 == strcmp(key, "name")) {
+                // name %<name>s
+                if (d) {
+                    if (tail) {
+                        tail->next = d;
+                    } else {
+                        head = d;
+                    } // if
+                    tail = d;
+                    d = NULL;
+                } // if
+
+                res = sscanf(&line[1+strlen(key)], " %16s", &buffer[3]);
+                if ((1 < res) || (3 > strlen(&buffer[3]))) {
+                    SYNTAX("<name> (e.g., 18f452) expected.");
+                } else {
+                    d = Safe_calloc(1, sizeof(PIC16_device));
+
+                    // { "p18f452", "18f452", "pic18f452", "f452" }
+                    buffer[0] = 'p';
+                    buffer[1] = 'i';
+                    buffer[2] = 'c';
+                    d->name[3] = Safe_strdup(&buffer[5]);
+                    d->name[2] = Safe_strdup(&buffer[0]);
+                    d->name[1] = Safe_strdup(&buffer[3]);
+                    buffer[2] = 'p';
+                    d->name[0] = Safe_strdup(&buffer[2]);
+                } // if
+            } else if (0 == strcmp(key, "using")) {
+                // using %<name>s
+                res = sscanf(&line[1+strlen(key)], " %16s", &buffer[0]);
+                if ((1 < res) || (3 > strlen(&buffer[3]))) {
+                    SYNTAX("<name> (e.g., 18f452) expected.");
+                } else {
+                    template = find_in_list(&buffer[0], head);
+                    if (!template) {
+                        SYNTAX("<name> (e.g., 18f452) expected.");
+                    } else {
+                        memcpy(&d->RAMsize, &template->RAMsize,
+                                ((char *)&d->next) - ((char *)&d->RAMsize));
+                    } // if
+                } // if
+            } else if (0 == strcmp(key, "ramsize")) {
+                // ramsize %<bytes>i
+                res = sscanf(&line[1+strlen(key)], " %i", &val[0]);
+                if (res < 1) {
+                    SYNTAX("<bytes> (e.g., 256) expected.");
+                } else {
+                    d->RAMsize = val[0];
+                } // if
+            } else if (0 == strcmp(key, "split")) {
+                // split %<offset>i
+                res = sscanf(&line[1+strlen(key)], " %i", &val[0]);
+                if (res < 1) {
+                    SYNTAX("<offset> (e.g., 0x80) expected.");
+                } else {
+                    d->acsSplitOfs = val[0];
+                } // if
+            } else if (0 == strcmp(key, "sfrrange")) {
+                // sfrrange %<first>i %<last>i
+                res = sscanf(&line[1+strlen(key)], " %i %i",
+                        &val[0], &val[1]);
+                if (res < 2) {
+                    SYNTAX("<first> <last> (e.g., 0xf60 0xfff) expected.");
+                } else {
+                    d->sfrRange.sfrLoAddr = val[0];
+                    d->sfrRange.sfrHiAddr = val[1];
+                } // if
+            } else if (0 == strcmp(key, "configrange")) {
+                // configrange %<first>i %<last>i
+                res = sscanf(&line[1+strlen(key)], " %i %i",
+                        &val[0], &val[1]);
+                if (res < 2) {
+                    SYNTAX("<first> <last> (e.g., 0xf60 0xfff) expected.");
+                } else {
+                    d->cwInfo.confAddrStart = val[0];
+                    d->cwInfo.confAddrEnd = val[1];
+                } // if
+            } else if (0 == strcmp(key, "configword")) {
+                // configword %<address>i %<mask>i %<value>i
+                res = sscanf(&line[1+strlen(key)], " %i %i %i",
+                        &val[0], &val[1], &val[2]);
+                if (res < 3) {
+                    SYNTAX("<address> <mask> <value> (e.g., 0x200001 0x0f 0x07) expected.");
+                } else {
+                    val[0] -= d->cwInfo.confAddrStart;
+                    if ((val[0] < 0)
+                            || (val[0] > (d->cwInfo.confAddrEnd - d->cwInfo.confAddrStart))
+                            || (val[0] >= CONFIGURATION_WORDS))
+                    {
+                        SYNTAX("address out of bounds.");
+                    } else {
+                        d->cwInfo.crInfo[val[0]].mask = val[1];
+                        d->cwInfo.crInfo[val[0]].value = val[2];
+                    } // if
+                } // if
+            } else if (0 == strcmp(key, "idlocrange")) {
+                // idlocrange %<first>i %<last>i
+                res = sscanf(&line[1+strlen(key)], " %i %i",
+                        &val[0], &val[1]);
+                if (res < 2) {
+                    SYNTAX("<first> <last> (e.g., 0xf60 0xfff) expected.");
+                } else {
+                    d->idInfo.idAddrStart = val[0];
+                    d->idInfo.idAddrEnd = val[1];
+                } // if
+            } else if (0 == strcmp(key, "idword")) {
+                // idword %<address>i %<value>i
+                res = sscanf(&line[1+strlen(key)], " %i %i",
+                        &val[0], &val[1]);
+                if (res < 2) {
+                    SYNTAX("<address> <value> (e.g., 0x3fffff 0x00) expected.");
+                } else {
+                    val[0] -= d->idInfo.idAddrStart;
+                    if ((val[0] < 0)
+                            || (val[0] > (d->idInfo.idAddrEnd - d->idInfo.idAddrStart))
+                            || (val[0] >= IDLOCATION_BYTES))
+                    {
+                        SYNTAX("address out of bounds.");
+                    } else {
+                        d->idInfo.irInfo[val[0]].value = val[1];
+                    } // if
+                } // if
+            } else {
+                printf("%s: Invalid keyword in %s ignored: %s\n",
+                        __func__, DEVICE_FILE_NAME, key);
+            } // if
+            free(line);
+        } // while
+
+        if (d) {
+            if (tail) {
+                tail->next = d;
+            } else {
+                head = d;
+            } // if
+            tail = d;
+            d = NULL;
+        } // if
+
+        devices = head;
+
+        fclose(f);
+    } // if
+
+    d = find_in_list(name, devices);
+    if (!d) {
+        d = &default_device;
+    } // if
+
+    return (d);
 }
 
 /*-----------------------------------------------------------------*
  *  
  *-----------------------------------------------------------------*/
-int pic16_picIsInitialized(void)
+void pic16_init_pic(const char *pic_type)
 {
-  if(pic16 && pic16->maxRAMaddress > 0)
-    return 1;
-
-  return 0;
-
+    pic16 = pic16_find_device(pic_type);
+
+    if (&default_device == pic16) {
+        if (pic_type) {
+            fprintf(stderr, "'%s' was not found.\n", pic_type);
+        } else {
+            fprintf(stderr, "No processor has been specified (use -pPROCESSOR_NAME)\n");
+        } // if
+
+        if (devices) {
+            fprintf(stderr,"Valid devices are (use --verbose for more details):\n");
+            pic16_list_devices(devices);
+        } // if
+        exit(EXIT_FAILURE);
+    } // if
 }
 
 /*-----------------------------------------------------------------*
@@ -685,7 +943,8 @@ void pic16_assignConfigWordValue(int address, unsigned int value)
 
         for(i=0;i<pic16->cwInfo.confAddrEnd-pic16->cwInfo.confAddrStart+1;i++) {
                 if((address == pic16->cwInfo.confAddrStart+i)
-                  && (pic16->cwInfo.crInfo[i].mask != -1)) {
+                  && (pic16->cwInfo.crInfo[i].mask != -1)
+                  && (pic16->cwInfo.crInfo[i].mask != 0)) {
 
 #if 0
                         fprintf(stderr, "setting location 0x%X to value 0x%x\tmask: 0x%x\ttest: 0x%x\n",
index 64dffb10a627e94c2803d1dd6ac6e1c2495f04fd..63b83572d15d3047f68267b507725b23711ddce7 100644 (file)
@@ -66,15 +66,15 @@ typedef struct {
 #define PROCESSOR_NAMES    4
 /* Processor unique attributes */
 typedef struct PIC16_device {
-  char *name[PROCESSOR_NAMES];/* aliases for the processor name */
-
-  int maxRAMaddress;           /* maximum value for a data address */
+  char *name[PROCESSOR_NAMES];  /* aliases for the processor name */
+  /* RAMsize *must* be the first item to copy for 'using' */
   int RAMsize;                 /* size of Data RAM - VR 031120 */
   int acsSplitOfs;             /* access bank split offset */
-  int extMIface;               /* device has external memory interface */
   sfrRangeInfo_t sfrRange;     /* SFR range */
   configWordsInfo_t cwInfo;    /* configuration words info */
   idBytesInfo_t idInfo;                /* ID Locations info */
+  /* next *must* be the first field NOT being copied via 'using' */
+  struct PIC16_device *next;    /* linked list */
 } PIC16_device;
 
 /* Given a pointer to a register, this macro returns the bank that it is in */
@@ -135,7 +135,6 @@ void pic16_assignConfigWordValue(int address, unsigned int value);
 void pic16_assignIdByteValue(int address, char value);
 int pic16_isREGinBank(regs *reg, int bank);
 int pic16_REGallBanks(regs *reg);
-void pic16_setMaxRAM(int size);
 int PIC16_IS_CONFIG_ADDRESS(int address);
 int PIC16_IS_IDLOC_ADDRESS(int address);
 int PIC16_IS_HWREG_ADDRESS(int address);
@@ -145,3 +144,4 @@ int checkAddSym(set **set, symbol *reg);
 int checkSym(set *set, symbol *reg);
 
 #endif  /* __DEVICE_H__ */
+
diff --git a/src/pic16/devices.inc b/src/pic16/devices.inc
deleted file mode 100644 (file)
index db49dad..0000000
+++ /dev/null
@@ -1,1434 +0,0 @@
-/*-------------------------------------------------------------------------
-  device.inc - pic16 device descriptions for inclusion into device.c
-
-   Written By -  Scott Dattalo scott@dattalo.com
-   Ported to PIC16 By -  Martin Dubuc m.dubuc@rogers.com
-   Moved from device.c - Raphael Neider <rneider AT web.de>
-
-   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
-   Free Software Foundation; either version 2, or (at your option) any
-   later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-   $Id$
--------------------------------------------------------------------------*/
-
-/* This file is included into device.c in order to populate the 
- * Pics16 array with the various device's descriptions.
- * For a reference of the structure to be filled in here see
- * PIC16_device in device.h.
- *
- * The list is scanned top-down, the first device entry matching the
- * desired processor name will be used. Temporary overrides of faulty
- * device descriptions can be specified be placing them near the top
- * of this file.
- */
-
-//  {
-//    {"p18f242", "18f242", "pic18f242", "f242", "18F242"},            // aliases
-//    0,
-//    0x300,                                           // RAMsize
-//    0,
-//    { 0xf80, 0xfff },       /* PIC18F242 range of SFR's */
-//     {
-//             /* PIC18F242 configuration words */
-//             0x300001,
-//             0x30000d,
-//             { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-//             { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-//             { -1, 0, 0xff } /* 7 */  , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-//             { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x03, 0, 0xff } /* c */ , 
-//             { 0x40, 0, 0xff } /* d */ } 
-//     }
-//  },
-
-  {
-    {"p18f242", "18f242", "pic18f242", "f242"},
-    0,
-    0x300,     /* 768 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F242 range of SFR's */
-    {
-    /* PIC18F242 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f248", "18f248", "pic18f248", "f248"},
-    0,
-    0x300,     /* 768 */
-    0x60,
-    0,
-    { 0xf00, 0xfff },  /* PIC18F248 range of SFR's */
-    {
-    /* PIC18F248 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { -1, 0, 0xff } /* 5 */  , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f252", "18f252", "pic18f252", "f252"},
-    0,
-    0x600,     /* 1536 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F252 range of SFR's */
-    {
-    /* PIC18F252 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f258", "18f258", "pic18f258", "f258"},
-    0,
-    0x600,     /* 1536 */
-    0x60,
-    0,
-    { 0xf00, 0xfff },  /* PIC18F258 range of SFR's */
-    {
-    /* PIC18F258 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { -1, 0, 0xff } /* 5 */  , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f442", "18f442", "pic18f442", "f442"},
-    0,
-    0x300,     /* 768 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F442 range of SFR's */
-    {
-    /* PIC18F442 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f448", "18f448", "pic18f448", "f448"},
-    0,
-    0x300,     /* 768 */
-    0x60,
-    0,
-    { 0xf00, 0xfff },  /* PIC18F448 range of SFR's */
-    {
-    /* PIC18F448 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { -1, 0, 0xff } /* 5 */  , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f452", "18f452", "pic18f452", "f452"},
-    0,
-    0x600,     /* 1536 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F452 range of SFR's */
-    {
-    /* PIC18F452 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f458", "18f458", "pic18f458", "f458"},
-    0,
-    0x600,     /* 1536 */
-    0x60,
-    0,
-    { 0xf00, 0xfff },  /* PIC18F458 range of SFR's */
-    {
-    /* PIC18F458 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { -1, 0, 0xff } /* 5 */  , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f1220", "18f1220", "pic18f1220", "f1220"},
-    0,
-    0x100,     /* 256 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F1220 range of SFR's */
-    {
-    /* PIC18F1220 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x80, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x03, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f1320", "18f1320", "pic18f1320", "f1320"},
-    0,
-    0x100,     /* 256 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F1320 range of SFR's */
-    {
-    /* PIC18F1320 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x80, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x03, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2220", "18f2220", "pic18f2220", "f2220"},
-    0,
-    0x200,     /* 512 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F2220 range of SFR's */
-    {
-    /* PIC18F2220 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x83, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2221", "18f2221", "pic18f2221", "f2221"}, // also: 2321, 4221, 4321
-    0,                 /* always 0 */
-    0x200,             /* RAM in bytes */
-    0x80,              /* access bank split */
-    0,                 /* always 0 */
-    { 0xf80, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,                /* first address */
-      0x30000d,                /* last address */
-      { { 0xcf, 0, 0x37 } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-        {  -1 , 0, 0xff } /* 4 */ , { 0x87, 0, 0xfb } /* 5 */ , { 0xf5, 0, 0x8f } /* 6 */ ,
-       {  -1 , 0, 0xff } /* 7 */ , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-       { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ ,  { 0x03, 0, 0xff } /* c */ ,
-       { 0x40, 0, 0xff } /* d */ }
-    },
-    /* IDLOCs --- always 0 */
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2320", "18f2320", "pic18f2320", "f2320"},
-    0,
-    0x200,     /* 512 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F2320 range of SFR's */
-    {
-    /* PIC18F2320 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x83, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2321", "18f2321", "pic18f2321", "f2321"}, // also: 2221, 4221, 4321
-    0,                 /* always 0 */
-    0x200,             /* RAM in bytes */
-    0x80,              /* access bank split */
-    0,                 /* always 0 */
-    { 0xf80, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,                /* first address */
-      0x30000d,                /* last address */
-      { { 0xcf, 0, 0x37 } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-        {  -1 , 0, 0xff } /* 4 */ , { 0x87, 0, 0xfb } /* 5 */ , { 0xf5, 0, 0x8f } /* 6 */ ,
-       {  -1 , 0, 0xff } /* 7 */ , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-       { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ ,  { 0x03, 0, 0xff } /* c */ ,
-       { 0x40, 0, 0xff } /* d */ }
-    },
-    /* IDLOCs --- always 0 */
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2331", "18f2331", "pic18f2331", "f2331"}, // also: 18f[24][34]31
-    0,                 /* always 0 */
-    0x300,             /* RAM in bytes */
-    0x60,              /* access bank split */
-    0,                 /* always 0 */
-    { 0xf60, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,                /* first address */
-      0x30000d,                /* last address */
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-        { 0x3c, 0, 0xff } /* 4 */ , { 0x9b, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ ,
-       {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-       { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ ,  { 0x0f, 0, 0xff } /* c */ ,
-       { 0x40, 0, 0xff } /* d */ }
-    },
-    /* IDLOCs --- always 0 */
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2420", "18f2420", "pic18f2420", "f2420"},    // also: 18f[24][45]20
-    0,
-    0x300,     /* 768 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F2420 range of SFR's */
-    {
-    /* PIC18F2420 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xc5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2423", "18f2423", "pic18f2423", "f2423"},
-    0,
-    0x300,     /* 768 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F2423 range of SFR's */
-    {
-    /* PIC18F2423 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xc5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2431", "18f2431", "pic18f2431", "f2431"}, // also: 18f[24][34]31
-    0,                 /* always 0 */
-    0x300,             /* RAM in bytes */
-    0x60,              /* access bank split */
-    0,                 /* always 0 */
-    { 0xf60, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,                /* first address */
-      0x30000d,                /* last address */
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-        { 0x3c, 0, 0xff } /* 4 */ , { 0x9b, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ ,
-       {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-       { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ ,  { 0x0f, 0, 0xff } /* c */ ,
-       { 0x40, 0, 0xff } /* d */ }
-    },
-    /* IDLOCs --- always 0 */
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2455", "18f2455", "pic18f2455", "f2455"},
-    0,
-    0x800,     /* 2048 */
-    0x60,
-    0,
-    { 0xf62, 0xfff },  /* PIC18F2455 range of SFR's */
-    {
-    /* PIC18F2455 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x3f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xe5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2480", "18f2480", "pic18f2480", "f2480"},
-    0,
-    0x300,     /*  768 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0x37 } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ ,
-        { 0x1f, 0, 0xff } /* 3 */ , {  -1 , 0, 0xff } /* 4 */ ,
-        { 0x86, 0, 0xfb } /* 5 */ , { 0xd5, 0, 0xaf } /* 6 */ ,
-        {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ ,
-        { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ ,
-        { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
-        { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007,
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f24j10", "18f24j10", "pic18f24j10", "f24j10"},                /* also 18f[24][45]j10  */
-    0,
-    0x1000,    /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F24j10 range of SFR's */
-    {
-    /* PIC18F24j10 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0xe1, 0, 0xff } /* 0 */ , { 0x07, 0, 0xff } /* 1 */ , { 0xc7, 0, 0xff } /* 2 */ , 
-      { 0x0f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , 
-      { -1, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */ , { -1, 0, 0xff } /* 8 */ , 
-      { -1, 0, 0xff } /* 9 */ , { -1, 0, 0xff } /* a */ , { -1, 0, 0xff } /* b */ , 
-      { -1, 0, 0xff } /* c */ , { -1, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2520", "18f2520", "pic18f2520", "f2520"},    // also: 18f[24][45]20
-    0,
-    0x600,     /* 1536 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F2520 range of SFR's */
-    {
-    /* PIC18F2520 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xc5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2523", "18f2523", "pic18f2523", "f2523"},
-    0,
-    0x600,     /* 1536 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F2523 range of SFR's */
-    {
-    /* PIC18F2523 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xc5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2525", "18f2525", "pic18f2525", "f2525"},
-    0,
-    0x1000,  /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },   /* PIC18F4525,2525 range of SFR's */
-    {
-    /* PIC18F4525,2525 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */ , { 0x87, 0, 0xff } /* 5 */ , { 0xc5, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x07, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x07, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x07, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007,
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2550", "18f2550", "pic18f2550", "f2550"},
-    0,
-    0x800,     /* 2048 */
-    0x60,
-    0,
-    { 0xf62, 0xfff },  /* PIC18F2550 range of SFR's */
-    {
-    /* PIC18F2550 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x3f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xe5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2580", "18f2580", "pic18f2580", "f2580"},
-    0,
-    0x600,     /* 1536 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0x37 } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ ,
-        { 0x1f, 0, 0xff } /* 3 */ , {  -1 , 0, 0xff } /* 4 */ ,
-        { 0x86, 0, 0xfb } /* 5 */ , { 0xd5, 0, 0xaf } /* 6 */ ,
-        {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ ,
-        { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ ,
-        { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
-        { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007,
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2585", "18f2585", "pic18f2585", "f2585"},
-    0,
-    0x1000,    /* 4096 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },  /* PIC18F2585,2680,4585,4680 range of SFR's */
-    {
-    /* PIC18F2585,2680,4585,4680 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ ,
-      { -1, 0, 0xff } /* 4 */ , { 0x86, 0, 0xff } /* 5 */ , { 0xf5, 0, 0xff } /* 6 */ ,
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
-      { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f25j10", "18f25j10", "pic18f25j10", "f25j10"},                /* also 18f[24][45]j10  */
-    0,
-    0x1000,    /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F25j10 range of SFR's */
-    {
-    /* PIC18F25j10 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0xe1, 0, 0xff } /* 0 */ , { 0x07, 0, 0xff } /* 1 */ , { 0xc7, 0, 0xff } /* 2 */ , 
-      { 0x0f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , 
-      { -1, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */ , { -1, 0, 0xff } /* 8 */ , 
-      { -1, 0, 0xff } /* 9 */ , { -1, 0, 0xff } /* a */ , { -1, 0, 0xff } /* b */ , 
-      { -1, 0, 0xff } /* c */ , { -1, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2620", "18f2620", "pic18f2620", "f2620"},
-    0,
-    0x1000,  /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },   /* PIC18F4620,2620 range of SFR's */
-    {
-    /* PIC18F4620,2620 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */ , { 0x87, 0, 0xff } /* 5 */ , { 0xc5, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2680", "18f2680", "pic18f2680", "f2680"},
-    0,
-    0x1000,    /* 4096 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },  /* PIC18F2585,2680,4585,4680 range of SFR's */
-    {
-    /* PIC18F2585,2680,4585,4680 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ ,
-      { -1, 0, 0xff } /* 4 */ , { 0x86, 0, 0xff } /* 5 */ , { 0xf5, 0, 0xff } /* 6 */ ,
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
-      { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2682", "18f2682", "pic18f2682", "f2682"},
-    0,
-    0x1000,  /* 4096 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },   /* PIC18F2682,2685,4682,4685 range of SFR's */
-    {
-    /* PIC18F2682,2685,4682,4685 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */ , { 0x86, 0, 0xff } /* 5 */ , { 0xf5, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */ , { 0x3f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x3f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x3f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f2685", "18f2685", "pic18f2685", "f2685"},
-    0,
-    0x1000,  /* 4096 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },   /* PIC18F2682,2685,4682,4685 range of SFR's */
-    {
-    /* PIC18F2682,2685,4682,4685 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */ , { 0x86, 0, 0xff } /* 5 */ , { 0xf5, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */ , { 0x3f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x3f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x3f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4220", "18f4220", "pic18f4220", "f4220"},
-    0,
-    0x200,     /* 512 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F4220 range of SFR's */
-    {
-    /* PIC18F4220 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x83, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4221", "18f4221", "pic18f4221", "f4221"}, // also: 2221, 2321, 4321
-    0,                 /* always 0 */
-    0x200,             /* RAM in bytes */
-    0x80,              /* access bank split */
-    0,                 /* always 0 */
-    { 0xf80, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,                /* first address */
-      0x30000d,                /* last address */
-      { { 0xcf, 0, 0x37 } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-        {  -1 , 0, 0xff } /* 4 */ , { 0x87, 0, 0xfb } /* 5 */ , { 0xf5, 0, 0x8f } /* 6 */ ,
-       {  -1 , 0, 0xff } /* 7 */ , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-       { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ ,  { 0x03, 0, 0xff } /* c */ ,
-       { 0x40, 0, 0xff } /* d */ }
-    },
-    /* IDLOCs --- always 0 */
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4320", "18f4320", "pic18f4320", "f4320"},
-    0,
-    0x200,     /* 512 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F4320 range of SFR's */
-    {
-    /* PIC18F4320 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */  , { 0x83, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4321", "18f4321", "pic18f4321", "f4321"}, // also: 2221, 2321, 4221
-    0,                 /* always 0 */
-    0x200,             /* RAM in bytes */
-    0x80,              /* access bank split */
-    0,                 /* always 0 */
-    { 0xf80, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,                /* first address */
-      0x30000d,                /* last address */
-      { { 0xcf, 0, 0x37 } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-        {  -1 , 0, 0xff } /* 4 */ , { 0x87, 0, 0xfb } /* 5 */ , { 0xf5, 0, 0x8f } /* 6 */ ,
-       {  -1 , 0, 0xff } /* 7 */ , { 0x03, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-       { 0x03, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ ,  { 0x03, 0, 0xff } /* c */ ,
-       { 0x40, 0, 0xff } /* d */ }
-    },
-    /* IDLOCs --- always 0 */
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4331", "18f4331", "pic18f4331", "f4331"}, // also: 18f[24][34]31
-    0,                 /* always 0 */
-    0x300,             /* RAM in bytes */
-    0x60,              /* access bank split */
-    0,                 /* always 0 */
-    { 0xf60, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,                /* first address */
-      0x30000d,                /* last address */
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-        { 0x3c, 0, 0xff } /* 4 */ , { 0x9b, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ ,
-       {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-       { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ ,  { 0x0f, 0, 0xff } /* c */ ,
-       { 0x40, 0, 0xff } /* d */ }
-    },
-    /* IDLOCs --- always 0 */
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4420", "18f4420", "pic18f4420", "f4420"},    // also: 18f[24][45]20
-    0,
-    0x300,     /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F4420 range of SFR's */
-    {
-    /* PIC18F4420 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xc5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4431", "18f4431", "pic18f4431", "f4431"}, // also: 18f[24][34]31
-    0,                 /* always 0 */
-    0x300,             /* RAM in bytes */
-    0x60,              /* access bank split */
-    0,                 /* always 0 */
-    { 0xf60, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,                /* first address */
-      0x30000d,                /* last address */
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-        { 0x3c, 0, 0xff } /* 4 */ , { 0x9b, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ ,
-       {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-       { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ ,  { 0x0f, 0, 0xff } /* c */ ,
-       { 0x40, 0, 0xff } /* d */ }
-    },
-    /* IDLOCs --- always 0 */
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4455", "18f4455", "pic18f4455", "f4455"},
-    0,
-    0x800,     /* 2048 */
-    0x60,
-    0,
-    { 0xf62, 0xfff },  /* PIC18F4455 range of SFR's */
-    {
-    /* PIC18F4455 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x3f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xe5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4480", "18f4480", "pic18f4480", "f4480"},
-    0,
-    0x300,     /*  768 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0x37 } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ ,
-        { 0x1f, 0, 0xff } /* 3 */ , {  -1 , 0, 0xff } /* 4 */ ,
-        { 0x86, 0, 0xfb } /* 5 */ , { 0xd5, 0, 0xaf } /* 6 */ ,
-        {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ ,
-        { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ ,
-        { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
-        { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007,
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f44j10", "18f44j10", "pic18f44j10", "f44j10"},                /* also 18f[24][45]j10  */
-    0,
-    0x1000,    /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F44j10 range of SFR's */
-    {
-    /* PIC18F44j10 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0xe1, 0, 0xff } /* 0 */ , { 0x07, 0, 0xff } /* 1 */ , { 0xc7, 0, 0xff } /* 2 */ , 
-      { 0x0f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , 
-      { -1, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */ , { -1, 0, 0xff } /* 8 */ , 
-      { -1, 0, 0xff } /* 9 */ , { -1, 0, 0xff } /* a */ , { -1, 0, 0xff } /* b */ , 
-      { -1, 0, 0xff } /* c */ , { -1, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4520", "18f4520", "pic18f4520", "f4520"},
-    0,
-    0x600,     /* 1536 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F4520 range of SFR's */
-    {
-    /* PIC18F4520 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xc5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4525", "18f4525", "pic18f4525", "f4525"},
-    0,
-    0x1000,  /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },   /* PIC18F4525,2525 range of SFR's */
-    {
-    /* PIC18F4525,2525 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */ , { 0x87, 0, 0xff } /* 5 */ , { 0xc5, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x07, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x07, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x07, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007,
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4550", "18f4550", "pic18f4550", "f4550"},
-    0,
-    0x800,     /* 2048 */
-    0x60,
-    0,
-    { 0xf62, 0xfff },  /* PIC18F4550 range of SFR's */
-    {
-    /* PIC18F4550 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0x3f, 0, 0xff } /* 0 */ , { 0xcf, 0, 0xff } /* 1 */ , { 0x3f, 0, 0xff } /* 2 */ , 
-      { 0x1f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x87, 0, 0xff } /* 5 */ , 
-      { 0xe5, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , 
-      { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , 
-      { 0x0f, 0, 0xff } /* c */ , { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4580", "18f4580", "pic18f4580", "f4580"},
-    0,
-    0x600,     /* 1536 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0x37 } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ ,
-        { 0x1f, 0, 0xff } /* 3 */ , {  -1 , 0, 0xff } /* 4 */ ,
-        { 0x86, 0, 0xfb } /* 5 */ , { 0xd5, 0, 0xaf } /* 6 */ ,
-        {  -1 , 0, 0xff } /* 7 */ , { 0x0f, 0, 0xff } /* 8 */ ,
-        { 0xc0, 0, 0xff } /* 9 */ , { 0x0f, 0, 0xff } /* a */ ,
-        { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
-        { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007,
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4585", "18f4585", "pic18f4585", "f4585"},
-    0,
-    0x1000,    /* 4096 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },  /* PIC18F2585,2680,4585,4680 range of SFR's */
-    {
-    /* PIC18F2585,2680,4585,4680 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ ,
-      { -1, 0, 0xff } /* 4 */ , { 0x86, 0, 0xff } /* 5 */ , { 0xf5, 0, 0xff } /* 6 */ ,
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
-      { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f45j10", "18f45j10", "pic18f45j10", "f45j10"},                /* also 18f[24][45]j10  */
-    0,
-    0x1000,    /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },  /* PIC18F45j10 range of SFR's */
-    {
-    /* PIC18F45j10 configuration words */
-      0x300000,
-      0x30000d,
-      { { 0xe1, 0, 0xff } /* 0 */ , { 0x07, 0, 0xff } /* 1 */ , { 0xc7, 0, 0xff } /* 2 */ , 
-      { 0x0f, 0, 0xff } /* 3 */ , { -1, 0, 0xff } /* 4 */  , { 0x01, 0, 0xff } /* 5 */ , 
-      { -1, 0, 0xff } /* 6 */ , { -1, 0, 0xff } /* 7 */ , { -1, 0, 0xff } /* 8 */ , 
-      { -1, 0, 0xff } /* 9 */ , { -1, 0, 0xff } /* a */ , { -1, 0, 0xff } /* b */ , 
-      { -1, 0, 0xff } /* c */ , { -1, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4620", "18f4620", "pic18f4620", "f4620"},
-    0,
-    0x1000,  /* 4096 */
-    0x80,
-    0,
-    { 0xf80, 0xfff },   /* PIC18F4620,2620 range of SFR's */
-    {
-    /* PIC18F4620,2620 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */ , { 0x87, 0, 0xff } /* 5 */ , { 0xc5, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4680", "18f4680", "pic18f4680", "f4680"},
-    0,
-    0x1000,    /* 4096 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },  /* PIC18F2585,2680,4585,4680 range of SFR's */
-    {
-    /* PIC18F2585,2680,4585,4680 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ ,
-      { -1, 0, 0xff } /* 4 */ , { 0x86, 0, 0xff } /* 5 */ , { 0xf5, 0, 0xff } /* 6 */ ,
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ ,
-      { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4682", "18f4682", "pic18f4682", "f4682"},
-    0,
-    0x1000,  /* 4096 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },   /* PIC18F2682,2685,4682,4685 range of SFR's */
-    {
-    /* PIC18F2682,2685,4682,4685 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { -1, 0, 0xff } /* 4 */ , { 0x86, 0, 0xff } /* 5 */ , { 0xf5, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */ , { 0x3f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x3f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x3f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f4685", "18f4685", "pic18f4685", "f4685"},
-    0,
-    0x1000,  /* 4096 */
-    0x60,
-    0,
-    { 0xd00, 0xfff },   /* PIC18F2682,2685,4682,4685 range of SFR's */
-    {
-    /* PIC18F2682,2685,4682,4685 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0xcf, 0, 0xff } /* 1 */ , { 0x1f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ ,
-      { -1, 0, 0xff } /* 4 */ , { 0x86, 0, 0xff } /* 5 */ , { 0xf5, 0, 0xff } /* 6 */ ,
-      { -1, 0, 0xff } /* 7 */ , { 0x3f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ ,
-      { 0x3f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x3f, 0, 0xff } /* c */ ,
-      { 0x40, 0, 0xff } /* d */ }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f6520", "18f6520", "pic18f6520", "f6520"},
-    0,
-    0x800,     /* 2048 */
-    0x60,
-    0,
-    { 0xf6b, 0xfff },  /* PIC18F6520 range of SFR's */
-    {
-    /* PIC18F6520 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x03, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0xff, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0xff, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0xff, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f6585", "18f6585", "pic18f6585", "f6585"},
-    0,
-    0xf00,     /* 3840 */
-    0x60,
-    0,
-    { 0xd60, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x2f, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x81, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f6620", "18f6620", "pic18f6620", "f6620"},
-    0,
-    0xf00,     /* 3840 */
-    0x60,
-    0,
-    { 0xf6b, 0xfff },  /* PIC18F6620 range of SFR's */
-    {
-    /* PIC18F6620 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x03, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0xff, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0xff, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0xff, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f6680", "18f6680", "pic18f6680", "f6680"},
-    0,
-    0xf00,     /* 3840 */
-    0x60,
-    0,
-    { 0xd60, 0xfff },  /* PIC18F6680 range of SFR's */
-    {
-    /* PIC18F6680 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x2f, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x81, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f6720", "18f6720", "pic18f6720", "f6720"},
-    0,
-    0xf00,     /* 3840 */
-    0x60,
-    0,
-    { 0xf6b, 0xfff },  /* PIC18F6720 range of SFR's */
-    {
-    /* PIC18F6720 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x03, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0xff, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0xff, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0xff, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f8520", "18f8520", "pic18f8520", "f8520"},
-    0,
-    0x800,     /* 2048 */
-    0x60,
-    1,
-    { 0xf6b, 0xfff },  /* PIC18F8520 range of SFR's */
-    {
-    /* PIC18F8520 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x03, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0xff, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0xff, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0xff, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f8585", "18f8585", "pic18f8585", "f8585"},
-    0,
-    0xf00,     /* 3840 */
-    0x60,
-    0,
-    { 0xd60, 0xfff },  /* range of SFR's */
-    {
-    /* configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x2f, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x81, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f8620", "18f8620", "pic18f8620", "f8620"},
-    0,
-    0xf00,     /* 3840 */
-    0x60,
-    1,
-    { 0xf6b, 0xfff },  /* PIC18F8620 range of SFR's */
-    {
-    /* PIC18F8620 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x03, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0xff, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0xff, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0xff, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f8680", "18f8680", "pic18f8680", "f8680"},
-    0,
-    0xf00,     /* 3840 */
-    0x60,
-    1,
-    { 0xd60, 0xfff },  /* PIC18F8680 range of SFR's */
-    {
-    /* PIC18F8680 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x2f, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x1f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x81, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0x0f, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0x0f, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0x0f, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  },
-  {
-    {"p18f8720", "18f8720", "pic18f8720", "f8720"},
-    0,
-    0xf00,     /* 3840 */
-    0x60,
-    1,
-    { 0xf6b, 0xfff },  /* PIC18F8720 range of SFR's */
-    {
-    /* PIC18F8720 configuration words */
-      0x300001,
-      0x30000d,
-      { { 0x27, 0, 0xff } /* 1 */ , { 0x0f, 0, 0xff } /* 2 */ , { 0x0f, 0, 0xff } /* 3 */ , 
-      { 0x83, 0, 0xff } /* 4 */ , { 0x03, 0, 0xff } /* 5 */ , { 0x85, 0, 0xff } /* 6 */ , 
-      { -1, 0, 0xff } /* 7 */  , { 0xff, 0, 0xff } /* 8 */ , { 0xc0, 0, 0xff } /* 9 */ , 
-      { 0xff, 0, 0xff } /* a */ , { 0xe0, 0, 0xff } /* b */ , { 0xff, 0, 0xff } /* c */ , 
-      { 0x40, 0, 0xff } /* d */  }
-    },
-    { 0x200000, 0x200007, 
-      { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, 
-        { 0, 0 }, { 0, 0 }, { 0, 0 } }
-    }
-  }
-
index ed20533ea3089acf6802c74d4cdba190b85061a3..ec2961c7989a6eeb4b2734e1bca1c41b0ce1c7f2 100644 (file)
@@ -163,8 +163,7 @@ struct {
 
 
 enum {
-  P_MAXRAM = 1,
-  P_STACK,
+  P_STACK = 1,
   P_CODE,
   P_UDATA,
   P_LIBRARY
@@ -181,31 +180,6 @@ do_pragma(int id, const char *name, const char *cp)
 
   switch (id)
     {
-    /* #pragma maxram [maxram] */
-    case P_MAXRAM:
-      {
-        int max_ram;
-
-        cp = get_pragma_token(cp, &token);
-        if (TOKEN_INT == token.type)
-          max_ram = token.val.int_val;
-        else
-          {
-            err = 1;
-            break;
-          }
-
-        cp = get_pragma_token(cp, &token);
-        if (TOKEN_EOL != token.type)
-          {
-            err = 1;
-            break;
-          }
-
-        pic16_setMaxRAM(max_ram);
-      }
-      break;
-
     /* #pragma stack [stack-position] [stack-len] */
     case  P_STACK:
       {
@@ -502,7 +476,6 @@ do_pragma(int id, const char *name, const char *cp)
 }
 
 static struct pragma_s pragma_tbl[] = {
-  { "maxram",  P_MAXRAM,  0, do_pragma },
   { "stack",   P_STACK,   0, do_pragma },
   { "code",    P_CODE,    0, do_pragma },
   { "udata",   P_UDATA,   0, do_pragma },
@@ -655,56 +628,25 @@ _pic16_parseOptions (int *pargc, char **argv, int *i)
   return FALSE;
 }
 
-extern set *userIncDirsSet;
+extern void pic16_init_pic(const char *name);
 
 static void _pic16_initPaths(void)
 {
-  set *pic16incDirsSet=NULL;
-  set *pic16libDirsSet=NULL;
-  char devlib[512];
-
-    setMainValue("mcu", pic16->name[2] );
-    addSet(&preArgvSet, Safe_strdup("-D{mcu}"));
-
-    setMainValue("mcu1", pic16->name[1] );
-    addSet(&preArgvSet, Safe_strdup("-D__{mcu1}"));
+    set *pic16libDirsSet=NULL;
 
-    if(!options.nostdinc) {
-      struct dbuf_s pic16incDir;
+    if (!options.nostdlib) {
+        struct dbuf_s pic16libDir;
 
-      dbuf_init(&pic16incDir, 128);
-      dbuf_makePath(&pic16incDir, INCLUDE_DIR_SUFFIX, "pic16");
-
-      /* setup pic16 include directory */
-      pic16incDirsSet = appendStrSet(dataDirsSet, NULL, dbuf_c_str(&pic16incDir));
-      dbuf_destroy(&pic16incDir);
-      includeDirsSet = pic16incDirsSet;
-//      mergeSets(&includeDirsSet, pic16incDirsSet);
-    }
-    /* pic16 port should not search to the SDCC standard include directories,
-     * so add here the deleted include dirs that user has issued in command line */
-    mergeSets(&pic16incDirsSet, userIncDirsSet);
-
-    if(!options.nostdlib) {
-      struct dbuf_s pic16libDir;
-
-      dbuf_init(&pic16libDir, 128);
-      dbuf_makePath(&pic16libDir, LIB_DIR_SUFFIX, "pic16");
-      /* setup pic16 library directory */
-      pic16libDirsSet = appendStrSet(dataDirsSet, NULL, dbuf_c_str(&pic16libDir));
-      dbuf_destroy(&pic16libDir);
-      libDirsSet = pic16libDirsSet;
-//      mergeSets(&libDirsSet, pic16libDirsSet);
+        dbuf_init(&pic16libDir, 128);
+        dbuf_makePath(&pic16libDir, LIB_DIR_SUFFIX, "pic16");
+        pic16libDirsSet = appendStrSet(dataDirsSet, NULL, dbuf_c_str(&pic16libDir));
+        dbuf_destroy(&pic16libDir);
+        mergeSets(&pic16libDirsSet, libDirsSet);
+        libDirsSet = pic16libDirsSet;
     }
 
-    if(!pic16_options.nodefaultlibs) {
-      /* now add the library for the device */
-      sprintf(devlib, "%s.lib", pic16->name[2]);
-      addSet(&libFilesSet, Safe_strdup(devlib));
-
-      /* add the internal SDCC library */
-      addSet(&libFilesSet, Safe_strdup( "libsdcc.lib" ));
-    }
+    /* now that we have the paths set up... */
+    pic16_init_pic(port->processor);
 }
 
 extern set *linkOptionsSet;
@@ -786,6 +728,8 @@ static void _pic16_linkEdit(void)
 static void
 _pic16_finaliseOptions (void)
 {
+    char devlib[512];
+
     port->mem.default_local_map = data;
     port->mem.default_globl_map = data;
 
@@ -803,6 +747,20 @@ _pic16_finaliseOptions (void)
     options.intlong_rent = 1;
 #endif
 
+    setMainValue("mcu", pic16->name[2] );
+    addSet(&preArgvSet, Safe_strdup("-D{mcu}"));
+
+    setMainValue("mcu1", pic16->name[1] );
+    addSet(&preArgvSet, Safe_strdup("-D__{mcu1}"));
+
+    if(!pic16_options.nodefaultlibs) {
+      /* now add the library for the device */
+      sprintf(devlib, "%s.lib", pic16->name[2]);
+      addSet(&libFilesSet, Safe_strdup(devlib));
+
+      /* add the internal SDCC library */
+      addSet(&libFilesSet, Safe_strdup( "libsdcc.lib" ));
+    }
 
     if(alt_asm && strlen(alt_asm))
       pic16_asmCmd[0] = alt_asm;
@@ -839,39 +797,6 @@ _pic16_finaliseOptions (void)
 }
 
 
-#if 0
-  if (options.model == MODEL_LARGE)
-    {
-      port->mem.default_local_map = xdata;
-      port->mem.default_globl_map = xdata;
-    }
-  else
-    {
-      port->mem.default_local_map = data;
-      port->mem.default_globl_map = data;
-    }
-
-  if (options.stack10bit)
-    {
-      if (options.model != MODEL_FLAT24)
-    {
-      fprintf (stderr,
-           "*** warning: 10 bit stack mode is only supported in flat24 model.\n");
-      fprintf (stderr, "\t10 bit stack mode disabled.\n");
-      options.stack10bit = 0;
-    }
-      else
-    {
-      /* Fixup the memory map for the stack; it is now in
-       * far space and requires a FPOINTER to access it.
-       */
-      istack->fmap = 1;
-      istack->ptrType = FPOINTER;
-    }
-    }
-#endif
-
-
 static void
 _pic16_setDefaultOptions (void)
 {
index 9ff1d2fd4174316efde09ad912715510048a5c88..f473a88048734401b3a48c990bc3f16f0e47c529 100644 (file)
@@ -156,7 +156,6 @@ extern void pic16_RemoveUnusedRegisters(void);
 extern void pic16_RegsUnMapLiveRanges(void);
 extern void pic16_BuildFlowTree(pBlock *pb);
 extern void pic16_pCodeRegOptimizeRegUsage(int level);
-extern int pic16_picIsInitialized(void);
 extern void SAFE_snprintf(char **str, size_t *size, const char *format, ...);
 extern int mnem2key(unsigned char const *mnem);
 
@@ -2954,10 +2953,8 @@ void SAFE_snprintf(char **str, size_t *size, const  char  *format, ...)
 #endif
 
 extern set *externs;
-extern  void pic16_initStack(int base_address, int size);
 extern regs *pic16_allocProcessorRegister(int rIdx, char * name, short po_type, int alias);
 extern regs *pic16_allocInternalRegister(int rIdx, char * name, short po_type, int alias);
-extern void pic16_init_pic(char *);
 
 void  pic16_pCodeInitRegisters(void)
 {
@@ -2968,9 +2965,6 @@ void  pic16_pCodeInitRegisters(void)
        
        initialized = 1;
 
-//     pic16_initStack(0xfff, 8);
-       pic16_init_pic(port->processor);
-
        pic16_pc_status.r = pic16_allocProcessorRegister(IDX_STATUS,"STATUS", PO_STATUS, 0x80);
        pic16_pc_pcl.r = pic16_allocProcessorRegister(IDX_PCL,"PCL", PO_PCL, 0x80);
        pic16_pc_pclath.r = pic16_allocProcessorRegister(IDX_PCLATH,"PCLATH", PO_PCLATH, 0x80);
@@ -8906,7 +8900,7 @@ int invalidatesBSR(pCode *pc)
 pseudoBankNr getBankFromBanksel (pCode *pc)
 {
   char *sym;
-  int data = (int)NULL;
+  int data = 0;
 
   if (!pc) return INVALID_BANK;
   
index 6bd0c35cec7ed8560ee9fe44b5de05d857386f05..07e4d1df0de0730084d20affa86bb6afc97716d9 100644 (file)
@@ -491,21 +491,6 @@ regFindFreeNext(set *dRegs, regs *creg)
   return NULL;
 }
 
-/*-----------------------------------------------------------------*/
-/* pic16_initStack - allocate registers for a pseudo stack               */
-/*-----------------------------------------------------------------*/
-void pic16_initStack(int base_address, int size)
-{
-
-  int i;
-
-  pic16_Gstack_base_addr = base_address;
-  //fprintf(stderr,"initStack");
-
-  for(i = 0; i<size; i++)
-    addSet(&pic16_dynStackRegs,newReg(REG_STK, PO_GPR_TEMP,base_address++,NULL,1,0, NULL));
-}
-
 /*-----------------------------------------------------------------*
  *-----------------------------------------------------------------*/
 regs *
index 653f973cc693f71ec8f0f1ed9a7728bd2fc56851..41e2269e72d2b47830d3ab7d0077c598f2aad248 100644 (file)
@@ -31,9 +31,6 @@
 
 #include "pcoderegs.h"
 
-extern unsigned int stackPos;
-extern unsigned int stackLen;
-
 enum
   {
     R2_IDX = 0, R3_IDX, R4_IDX,
index fca9ccc2406cc73ac49f4e4d2bdf7e897b4d1abe..f2eb459daa401addb0839d055776b6e68f148943 100755 (executable)
@@ -2,6 +2,7 @@
 
 use strict;
 
+#
 # Parse MPASM include files to extract SDCC header/device library files
 # This script is (c) 2007 by Raphael Neider <rneider AT web.de>,
 # it is licensed under the terms of the GPL v2.
@@ -19,12 +20,16 @@ use strict;
 # 5. adjust $SDCC/device/lib/pic16/libio/*.ignore if the device
 #    does not support ADC, I2C, or USART
 # 6. edit $SDCC/device/include/pic16/pic18fregs.h
-# 7. edit $SDCC/src/pic16/devices.inc
+# 7. edit $SDCC/device/include/pic16/pic16devices.txt
 #
 # The file format of steps 6 and 7 is self explanatory, in most
 # if not all cases you can copy and paste another device's records
 # and adjust them to the newly added device.
 #
+# Please try to add device families (with a common datasheet) rather
+# than a single device and use the .h and .c files of the largest
+# device for all (using #include "largest.c" and #include "largest.h").
+#
 
 my $SCRIPT = $0;
 $SCRIPT =~ s/.*\///g; # remove path prefix
index 5ca1890cb5e8ec475a528ca85bf65ce558f41291..faf9895ba8683de8950820c2046f98cf8f2c2df9 100644 (file)
@@ -426,6 +426,7 @@ ${Section} "SDCC include files" SEC05
   File "${DEV_ROOT}\include\pic\*.inc"
   SetOutPath "$INSTDIR\include\pic16"
   File "${DEV_ROOT}\include\pic16\*.h"
+  File "${DEV_ROOT}\include\pic16\*.txt"
   SetOutPath "$INSTDIR\include\z80"
   File "${DEV_ROOT}\include\z80\*.h"
   SetOutPath "$INSTDIR\include"