1 /*-------------------------------------------------------------------------
3 device.c - Accomodates subtle variations in PIC devices
4 Written By - Scott Dattalo scott@dattalo.com
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 -------------------------------------------------------------------------*/
25 #include "common.h" // Include everything in the SDCC src directory
34 extern int Gstack_base_addr;
35 extern int Gstack_size;
37 #define MAX_PICLIST 200
38 static PIC_device *Pics[MAX_PICLIST];
39 static int num_of_supported_PICS = 0;
41 static PIC_device *pic=NULL;
43 int maxRAMaddress = 0;
45 #define CONFIG_WORD_ADDRESS 0x2007
46 #define CONFIG2_WORD_ADDRESS 0x2008
47 #define DEFAULT_CONFIG_WORD 0x3fff
48 #define DEFAULT_CONFIG2_WORD 0x3ffc
50 #define DEVICE_FILE_NAME "pic14devices.txt"
51 #define PIC14_STRING_LEN 256
52 #define SPLIT_WORDS_MAX 16
54 static unsigned int config_word = DEFAULT_CONFIG_WORD;
55 static unsigned int config2_word = DEFAULT_CONFIG2_WORD;
56 static memRange *rangeRAM = NULL;
59 /* parse a value from the configuration file */
60 static int parse_config_value(char *str)
62 if (str[strlen(str) - 1] == 'K')
63 return atoi(str) * 1024; /* like "1K" */
65 else if (STRNCASECMP(str, "0x", 2) == 0)
66 return strtol(str+2, NULL, 16); /* like "0x400" */
69 return atoi(str); /* like "1024" */
73 /* split a line into words */
74 static int split_words(char result_word[SPLIT_WORDS_MAX][PIC14_STRING_LEN], char *str)
80 while (*pos != '\0' && num_words < SPLIT_WORDS_MAX) {
81 /* remove leading spaces */
82 while (isspace(*pos) || *pos == ',')
85 /* copy everything up until the first space or comma */
86 for (ccount = 0; *pos != '\0' && !isspace(*pos) && *pos != ',' && ccount < PIC14_STRING_LEN-1; ccount++, pos++)
87 result_word[num_words][ccount] = *pos;
88 result_word[num_words][ccount] = '\0';
97 /* remove annoying prefixes from the processor name */
98 static char *sanitise_processor_name(char *name)
100 char *proc_pos = name;
105 if (STRNCASECMP(proc_pos, "pic", 3) == 0)
108 else if (tolower(*proc_pos) == 'p')
115 /* create a structure for a pic processor */
116 static PIC_device *create_pic(char *pic_name, int maxram, int bankmsk, int confsiz, int program, int data, int eeprom, int io)
119 char *simple_pic_name = sanitise_processor_name(pic_name);
121 new_pic = Safe_calloc(1, sizeof(PIC_device));
122 new_pic->name = Safe_calloc(strlen(simple_pic_name)+1, sizeof(char));
123 strcpy(new_pic->name, simple_pic_name);
125 new_pic->defMaxRAMaddrs = maxram;
126 new_pic->bankMask = bankmsk;
127 new_pic->hasSecondConfigReg = confsiz > 1;
129 new_pic->programMemSize = program;
130 new_pic->dataMemSize = data;
131 new_pic->eepromMemSize = eeprom;
132 new_pic->ioPins = io;
134 new_pic->ram = rangeRAM;
136 Pics[num_of_supported_PICS] = new_pic;
137 num_of_supported_PICS++;
143 /* mark some registers as being duplicated across banks */
144 static void register_map(int num_words, char word[SPLIT_WORDS_MAX][PIC14_STRING_LEN])
150 fprintf(stderr, "WARNING: not enough values in %s regmap directive\n", DEVICE_FILE_NAME);
154 for (pcount = 2; pcount < num_words; pcount++) {
155 r = Safe_calloc(1, sizeof(memRange));
157 r->start_address = parse_config_value(word[pcount]);
158 r->end_address = parse_config_value(word[pcount]);
159 r->alias = parse_config_value(word[1]);
160 r->bank = (r->start_address >> 7) & 3;
161 // add memRange to device entry for future lookup (sharebanks)
168 /* define ram areas - may be duplicated across banks */
169 static void ram_map(int num_words, char word[SPLIT_WORDS_MAX][PIC14_STRING_LEN])
174 fprintf(stderr, "WARNING: not enough values in %s memmap directive\n", DEVICE_FILE_NAME);
178 r = Safe_calloc(1, sizeof(memRange));
179 //fprintf (stderr, "%s: %s %s %s\n", __FUNCTION__, word[1], word[2], word[3]);
181 r->start_address = parse_config_value(word[1]);
182 r->end_address = parse_config_value(word[2]);
183 r->alias = parse_config_value(word[3]);
184 r->bank = (r->start_address >> 7) & 3;
186 // add memRange to device entry for future lookup (sharebanks)
191 extern set *includeDirsSet;
192 extern set *userIncDirsSet;
193 extern set *libDirsSet;
194 extern set *libPathsSet;
196 /* read the file with all the pic14 definitions and pick out the definition for a processor
197 * if specified. if pic_name is NULL reads everything */
198 static PIC_device *find_device(char *pic_name)
201 char pic_buf[PIC14_STRING_LEN];
203 int found_processor = FALSE;
205 char processor_name[SPLIT_WORDS_MAX][PIC14_STRING_LEN];
206 int num_processor_names = 0;
214 char *simple_pic_name;
219 /* allow abbreviations of the form "f877" - convert to "16f877" */
220 simple_pic_name = sanitise_processor_name(pic_name);
221 num_of_supported_PICS = 0;
223 /* open the piclist file */
224 /* first scan all include directories */
226 //fprintf( stderr, "%s: searching %s\n", __FUNCTION__, DEVICE_FILE_NAME );
227 for (dir = setFirstItem(includeDirsSet);
229 dir = setNextItem(includeDirsSet))
231 //fprintf( stderr, "searching1 %s\n", dir );
232 SNPRINTF(&filename[0], len, "%s%s%s", dir, DIR_SEPARATOR_STRING, DEVICE_FILE_NAME);
233 pic_file = fopen( filename, "rt" );
236 for (dir = setFirstItem(userIncDirsSet);
238 dir = setNextItem(userIncDirsSet))
240 //fprintf( stderr, "searching2 %s\n", dir );
241 SNPRINTF(&filename[0], len, "%s%s%s", dir, DIR_SEPARATOR_STRING, DEVICE_FILE_NAME);
242 pic_file = fopen( filename, "rt" );
245 for (dir = setFirstItem(libDirsSet);
247 dir = setNextItem(libDirsSet))
249 //fprintf( stderr, "searching3 %s\n", dir );
250 SNPRINTF(&filename[0], len, "%s%s%s", dir, DIR_SEPARATOR_STRING, DEVICE_FILE_NAME);
251 pic_file = fopen( filename, "rt" );
254 for (dir = setFirstItem(libPathsSet);
256 dir = setNextItem(libPathsSet))
258 //fprintf( stderr, "searching4 %s\n", dir );
259 SNPRINTF(&filename[0], len, "%s%s%s", dir, DIR_SEPARATOR_STRING, DEVICE_FILE_NAME);
260 pic_file = fopen( filename, "rt" );
264 pic_file = fopen(DATADIR LIB_DIR_SUFFIX DIR_SEPARATOR_STRING "pic" DIR_SEPARATOR_STRING DEVICE_FILE_NAME, "rt");
266 if (pic_file == NULL) {
267 /* this second attempt is used when initially building the libraries */
268 pic_file = fopen(".." DIR_SEPARATOR_STRING ".." DIR_SEPARATOR_STRING ".." DIR_SEPARATOR_STRING ".."
269 DIR_SEPARATOR_STRING "src" DIR_SEPARATOR_STRING "pic" DIR_SEPARATOR_STRING
270 DEVICE_FILE_NAME, "rt");
271 if (pic_file == NULL) {
272 fprintf(stderr, "can't find %s\n", DATADIR LIB_DIR_SUFFIX DIR_SEPARATOR_STRING "pic"
273 DIR_SEPARATOR_STRING DEVICE_FILE_NAME);
278 /* read line by line */
279 pic_buf[sizeof(pic_buf)-1] = '\0';
280 while (fgets(pic_buf, sizeof(pic_buf)-1, pic_file) != NULL && !done) {
282 /* remove trailing spaces */
283 while (isspace(pic_buf[strlen(pic_buf)-1]))
284 pic_buf[strlen(pic_buf)-1] = '\0';
286 /* remove leading spaces */
287 for (pic_buf_pos = pic_buf; isspace(*pic_buf_pos); pic_buf_pos++)
290 /* ignore comment / empty lines */
291 if (*pic_buf_pos != '\0' && *pic_buf_pos != '#') {
293 /* split into fields */
294 char pic_word[SPLIT_WORDS_MAX][PIC14_STRING_LEN];
298 num_pic_words = split_words(pic_word, pic_buf_pos);
300 if (STRCASECMP(pic_word[0], "processor") == 0) {
302 if (pic_name == NULL) {
303 /* this is the mode where we read all the processors in - store the names for now */
304 if (num_processor_names > 0) {
305 /* store away all the previous processor definitions */
308 for (dcount = 1; dcount < num_processor_names; dcount++)
309 create_pic(processor_name[dcount], pic_maxram, pic_bankmsk,
310 pic_confsiz, pic_program, pic_data, pic_eeprom, pic_io);
313 num_processor_names = split_words(processor_name, pic_buf_pos);
316 /* if we've just completed reading a processor definition stop now */
320 /* check if this processor name is a match */
321 for (wcount = 1; wcount < num_pic_words; wcount++) {
323 /* skip uninteresting prefixes */
324 char *found_name = sanitise_processor_name(pic_word[wcount]);
326 if (STRCASECMP(found_name, simple_pic_name) == 0)
327 found_processor = TRUE;
334 if (found_processor || pic_name == NULL) {
335 /* only parse a processor section if we've found the one we want */
336 if (STRCASECMP(pic_word[0], "maxram") == 0 && num_pic_words > 1) {
337 pic_maxram = parse_config_value(pic_word[1]);
338 setMaxRAM(pic_maxram);
340 else if (STRCASECMP(pic_word[0], "bankmsk") == 0 && num_pic_words > 1)
341 pic_bankmsk = parse_config_value(pic_word[1]);
343 else if (STRCASECMP(pic_word[0], "confsiz") == 0 && num_pic_words > 1)
344 pic_confsiz = parse_config_value(pic_word[1]);
346 else if (STRCASECMP(pic_word[0], "program") == 0 && num_pic_words > 1)
347 pic_program = parse_config_value(pic_word[1]);
349 else if (STRCASECMP(pic_word[0], "data") == 0 && num_pic_words > 1)
350 pic_data = parse_config_value(pic_word[1]);
352 else if (STRCASECMP(pic_word[0], "eeprom") == 0 && num_pic_words > 1)
353 pic_eeprom = parse_config_value(pic_word[1]);
355 else if (STRCASECMP(pic_word[0], "io") == 0 && num_pic_words > 1)
356 pic_io = parse_config_value(pic_word[1]);
358 else if (STRCASECMP(pic_word[0], "regmap") == 0 && num_pic_words > 2) {
360 register_map(num_pic_words, pic_word);
362 else if (STRCASECMP(pic_word[0], "memmap") == 0 && num_pic_words > 2) {
364 ram_map(num_pic_words, pic_word);
367 fprintf(stderr, "WARNING: %s: bad syntax `%s'\n", DEVICE_FILE_NAME, pic_word[0]);
376 /* if we're in read-the-lot mode then create the final processor definition */
377 if (pic_name == NULL) {
379 if (num_processor_names > 0) {
380 /* store away all the previous processor definitions */
383 for (dcount = 1; dcount < num_processor_names; dcount++)
384 create_pic(processor_name[dcount], pic_maxram, pic_bankmsk,
385 pic_confsiz, pic_program, pic_data, pic_eeprom, pic_io);
390 if (found_processor) {
391 /* create a new pic entry */
392 return create_pic(pic_name, pic_maxram, pic_bankmsk,
393 pic_confsiz, pic_program, pic_data, pic_eeprom, pic_io);
400 void setMaxRAM(int size)
402 maxRAMaddress = size;
404 if (maxRAMaddress < 0) {
405 fprintf(stderr, "invalid maxram 0x%x setting in %s\n",
406 maxRAMaddress, DEVICE_FILE_NAME);
411 /*-----------------------------------------------------------------*
412 *-----------------------------------------------------------------*/
414 int isREGinBank(regs *reg, int bank)
420 if((int)((reg->address | reg->alias) & pic->bankMask & bank) == bank)
426 /*-----------------------------------------------------------------*
427 *-----------------------------------------------------------------*/
428 int REGallBanks(regs *reg)
434 return ((reg->address | reg->alias) & pic->bankMask);
438 /*-----------------------------------------------------------------*
439 * void list_valid_pics(int ncols, int list_alias)
441 * Print out a formatted list of valid PIC devices
443 * ncols - number of columns in the list.
445 * list_alias - if non-zero, print all of the supported aliases
446 * for a device (e.g. F84, 16F84, etc...)
447 *-----------------------------------------------------------------*/
448 void list_valid_pics(int ncols)
453 if (num_of_supported_PICS == 0)
454 find_device(NULL); /* load all the definitions */
456 /* decrement the column number if it's greater than zero */
457 ncols = (ncols > 1) ? ncols-1 : 4;
459 /* Find the device with the longest name */
460 for(i=0,longest=0; i<num_of_supported_PICS; i++) {
461 k = strlen(Pics[i]->name);
468 fprintf(stderr, "\nPIC14 processors and their characteristics:\n\n");
469 fprintf(stderr, " processor");
470 for(k=0; k<longest-1; k++)
472 fprintf(stderr, "program RAM EEPROM I/O\n");
473 fprintf(stderr, "-----------------------------------------------------\n");
475 for(i=0; i < num_of_supported_PICS; i++) {
476 fprintf(stderr," %s", Pics[i]->name);
477 l = longest + 2 - strlen(Pics[i]->name);
481 fprintf(stderr, " ");
482 if (Pics[i]->programMemSize % 1024 == 0)
483 fprintf(stderr, "%4dK", Pics[i]->programMemSize / 1024);
485 fprintf(stderr, "%5d", Pics[i]->programMemSize);
487 fprintf(stderr, " %5d %5d %4d\n",
488 Pics[i]->dataMemSize, Pics[i]->eepromMemSize, Pics[i]->ioPins);
493 fprintf(stderr, "\nPIC14 processors supported:\n");
494 for(i=0; i < num_of_supported_PICS; i++) {
496 fprintf(stderr,"%s", Pics[i]->name);
498 l = longest + 2 - strlen(Pics[i]->name);
515 /*-----------------------------------------------------------------*
517 *-----------------------------------------------------------------*/
518 PIC_device *init_pic(char *pic_type)
520 char long_name[PIC14_STRING_LEN];
522 pic = find_device(pic_type);
525 /* check for shortened "16xxx" form */
526 sprintf(long_name, "16%s", pic_type);
527 pic = find_device(long_name);
529 if(pic_type != NULL && pic_type[0] != '\0')
530 fprintf(stderr, "'%s' was not found.\n", pic_type);
532 fprintf(stderr, "No processor has been specified (use -pPROCESSOR_NAME)\n");
541 /*-----------------------------------------------------------------*
543 *-----------------------------------------------------------------*/
544 int picIsInitialized(void)
546 if(pic && maxRAMaddress > 0)
553 /*-----------------------------------------------------------------*
554 * char *processor_base_name(void) - Include file is derived from this.
555 *-----------------------------------------------------------------*/
556 char *processor_base_name(void)
565 /*-----------------------------------------------------------------*
566 *-----------------------------------------------------------------*/
567 int validAddress(int address, int reg_size)
569 if (maxRAMaddress < 0) {
570 fprintf(stderr, "missing maxram setting in %s\n", DEVICE_FILE_NAME);
573 // fprintf(stderr, "validAddress: Checking 0x%04x\n",address);
574 assert (reg_size > 0);
575 if(address + (reg_size - 1) > maxRAMaddress)
582 /* The following code should be (and is) implemented in the linker. */
584 /*-----------------------------------------------------------------*
585 *-----------------------------------------------------------------*/
586 void mapRegister(regs *reg)
592 if(!reg || !reg->size) {
593 fprintf(stderr,"WARNING: %s:%s:%d Bad register\n",__FILE__,__FUNCTION__,__LINE__);
597 if (maxRAMaddress < 0) {
598 fprintf(stderr, "missing maxram setting in %s\n", DEVICE_FILE_NAME);
602 for(i=0; i<reg->size; i++) {
604 assert(reg->address >= 0 && reg->address < maxRAMaddress);
606 alias = finalMapping[reg->address].alias;
611 //fprintf(stdout,"mapping %s to address 0x%02x, reg size = %d\n",reg->name, (reg->address+alias+i),reg->size);
613 finalMapping[reg->address + alias + i].reg = reg;
614 finalMapping[reg->address + alias + i].instance = i;
616 /* Decrement alias */
618 alias -= ((alias & (alias - 1)) ^ alias);
625 //fprintf(stderr,"%s - %s addr = 0x%03x, size %d\n",__FUNCTION__,reg->name, reg->address,reg->size);
631 /*-----------------------------------------------------------------*
632 *-----------------------------------------------------------------*/
633 int assignRegister(regs *reg, int start_address)
637 //fprintf(stderr,"%s - %s start_address = 0x%03x\n",__FUNCTION__,reg->name, start_address);
640 if (validAddress(reg->address,reg->size)) {
641 //fprintf(stderr,"%s - %s address = 0x%03x\n",__FUNCTION__,reg->name, reg->address);
646 if (getenv("SDCCPICDEBUG")) {
647 fprintf(stderr, "WARNING: Ignoring Out of Range register assignment at fixed address %d, %s\n",
648 reg->address, reg->name);
653 /* This register does not have a fixed address requirement
654 * so we'll search through all availble ram address and
655 * assign the first one */
657 for (i=start_address; i<=maxRAMaddress; i++) {
659 if (validAddress(i,reg->size)) {
666 fprintf(stderr, "WARNING: No more RAM available for %s\n",reg->name);
673 /*-----------------------------------------------------------------*
674 *-----------------------------------------------------------------*/
675 void assignFixedRegisters(set *regset)
679 for (reg = setFirstItem(regset) ; reg ;
680 reg = setNextItem(regset)) {
683 assignRegister(reg,0);
688 /*-----------------------------------------------------------------*
689 *-----------------------------------------------------------------*/
690 void assignRelocatableRegisters(set *regset, int used)
696 for (reg = setFirstItem(regset) ; reg ;
697 reg = setNextItem(regset)) {
699 //fprintf(stdout,"assigning %s (%d) isFixed=%d, wasUsed=%d\n",reg->name,reg->size,reg->isFixed,reg->wasUsed);
701 if((!reg->isExtern) && (!reg->isFixed) && ( used || reg->wasUsed)) {
702 /* If register have been reused then shall not print it a second time. */
705 for (s = regset; s; s = s->next) {
710 if((!r->isFixed) && ( used || r->wasUsed)) {
711 if (r->rIdx == reg->rIdx) {
712 reg->address = r->address;
719 address = assignRegister(reg,address);
726 /* Keep track of whether we found an assignment to the __config words. */
727 static int pic14_hasSetConfigWord = 0;
729 /*-----------------------------------------------------------------*
730 * void assignConfigWordValue(int address, int value)
732 * Most midrange PICs have one config word at address 0x2007.
733 * Newer PIC14s have a second config word at address 0x2008.
734 * This routine will assign values to those addresses.
736 *-----------------------------------------------------------------*/
738 void pic14_assignConfigWordValue(int address, int value)
740 if (CONFIG_WORD_ADDRESS == address)
743 else if (CONFIG2_WORD_ADDRESS == address)
744 config2_word = value;
746 //fprintf(stderr,"setting config word 0x%x to 0x%x\n", address, value);
747 pic14_hasSetConfigWord = 1;
750 /*-----------------------------------------------------------------*
751 * int pic14_emitConfigWord (FILE * vFile)
753 * Emit the __config directives iff we found a previous assignment
754 * to the config word.
755 *-----------------------------------------------------------------*/
756 extern char *iComments2;
757 int pic14_emitConfigWord (FILE * vFile)
759 if (pic14_hasSetConfigWord)
761 fprintf (vFile, "%s", iComments2);
762 fprintf (vFile, "; config word \n");
763 fprintf (vFile, "%s", iComments2);
764 if (pic14_getHasSecondConfigReg())
766 fprintf (vFile, "\t__config _CONFIG1, 0x%x\n", pic14_getConfigWord(0x2007));
767 fprintf (vFile, "\t__config _CONFIG2, 0x%x\n", pic14_getConfigWord(0x2008));
770 fprintf (vFile, "\t__config 0x%x\n", pic14_getConfigWord(0x2007));
777 /*-----------------------------------------------------------------*
778 * int pic14_getConfigWord(int address)
780 * Get the current value of a config word.
782 *-----------------------------------------------------------------*/
784 int pic14_getConfigWord(int address)
788 case CONFIG_WORD_ADDRESS:
791 case CONFIG2_WORD_ADDRESS:
799 /*-----------------------------------------------------------------*
801 *-----------------------------------------------------------------*/
802 unsigned pic14_getMaxRam(void)
804 return pic->defMaxRAMaddrs;
808 /*-----------------------------------------------------------------*
809 * int getHasSecondConfigReg(void) - check if the device has a
810 * second config register, rather than just one.
811 *-----------------------------------------------------------------*/
812 int pic14_getHasSecondConfigReg(void)
817 return pic->hasSecondConfigReg;
820 /*-----------------------------------------------------------------*
821 * True iff the device has memory aliased in every bank.
822 * If true, low and high will be set to the low and high address
823 * occupied by the (last) sharebank found.
824 *-----------------------------------------------------------------*/
825 int pic14_hasSharebank(int *low, int *high, int *size)
833 //fprintf (stderr, "%s: region %x..%x, bank %x, alias %x, pic->bankmask %x, min_size %d\n", __FUNCTION__, r->start_address, r->end_address, r->bank, r->alias, pic->bankMask, size ? *size : 0);
834 // find sufficiently large shared region
835 if ((r->alias == pic->bankMask)
836 && (r->end_address != r->start_address) // ignore SFRs
837 && (!size || (*size <= (r->end_address - r->start_address + 1))))
839 if (low) *low = r->start_address;
840 if (high) *high = r->end_address;
841 if (size) *size = r->end_address - r->start_address + 1;
848 if (high) *high = 0x0;
849 if (size) *size = 0x0;
850 //fprintf (stderr, "%s: no shared bank found\n", __FUNCTION__);
855 * True iff the memory region [low, high] is aliased in all banks.
857 int pic14_isShared(int low, int high)
865 //fprintf (stderr, "%s: region %x..%x, bank %x, alias %x, pic->bankmask %x\n", __FUNCTION__, r->start_address, r->end_address, r->bank, r->alias, pic->bankMask);
866 if ((r->alias == pic->bankMask) && (r->start_address <= low) && (r->end_address >= high)) {
876 * True iff all RAM is aliased in all banks (no BANKSELs required except for
879 int pic14_allRAMShared(void)
887 if (r->alias != pic->bankMask) return 0;
895 * True iff the pseudo stack is a sharebank --> let linker place it.
896 * [low, high] denotes a size byte long block of (shared or banked)
899 int pic14_getSharedStack(int *low, int *high, int *size)
904 s = options.stack_size ? options.stack_size : 0x10;
905 haveShared = pic14_hasSharebank(&l, &h, &s);
906 if ((options.stack_loc != 0) || !haveShared)
908 // sharebank not available or not to be used
909 s = options.stack_size ? options.stack_size : 0x10;
910 l = options.stack_loc ? options.stack_loc : 0x20;
915 // return 1 iff [low, high] is present in all banks
916 //fprintf(stderr, "%s: low %x, high %x, size %x, shared %d\n", __FUNCTION__, l, h, s, pic14_isShared(l, h));
917 return (pic14_isShared(l, h));
919 // sharebanks available for use by the stack
920 if (options.stack_size) s = options.stack_size;
921 else if (!s || s > 16) s = 16; // limit stack to 16 bytes in SHAREBANK
923 // provide addresses for sharebank
925 if (high) *high = l + s - 1;
927 //fprintf(stderr, "%s: low %x, high %x, size %x, shared 1\n", __FUNCTION__, l, h, s);
932 PIC_device * pic14_getPIC(void)