* doc/sdccman.lyx: removed PIC16 from PIC16 Port Specific Options,
[fw/sdcc] / src / pic16 / device.c
index 3b33b564b707fc55937cb79e0c225b8403e764ac..6a5c7006b31fcae72178edab4214a0f8f0f1a0fc 100644 (file)
@@ -1,6 +1,7 @@
 /*-------------------------------------------------------------------------
 
-   device.c - Accomodates subtle variations in PIC16 devices
+  device.c - Accomodates subtle variations in PIC16 devices
+
    Written By -  Scott Dattalo scott@dattalo.com
    Ported to PIC16 By -  Martin Dubuc m.dubuc@rogers.com
 
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 -------------------------------------------------------------------------*/
 
+
+/*
+       VR - Began writing code to make PIC16 C source files independent from
+       the header file (created by the inc2h.pl)
+
+       - adding maximum RAM memory into PIC_Device structure
+
+*/
+
 #include <stdio.h>
 
 #include "common.h"   // Include everything in the SDCC src directory
 #include "ralloc.h"
 #include "device.h"
 
-#if defined(__BORLANDC__) || defined(_MSC_VER)
-#define STRCASECMP stricmp
-#else
-#define STRCASECMP strcasecmp
-#endif
 
-static PIC_device Pics[] = {
+static PIC16_device Pics16[] = {
   {
-    {"p18f242", "18f242", "pic18f242", "f242"},
-    (memRange *)NULL,
-    (memRange *)NULL,
+    {"p18f242", "18f242", "pic18f242", "f242"},                // aliases
     0,
-    0x300,
+    0x300,                                             // bank mask
+    0x300,                                             // RAMsize
+    0
   },
 
   {
-    {"p18f252", "18f252", "pic18f252", "f252"},
-    (memRange *)NULL,
-    (memRange *)NULL,
+    {"p18f252", "18f252", "pic18f252", "f252"},                // aliases
     0,
-    0x600,
+    0x600,                                             // bank mask
+    0x600,                                             // RAMsize
+    0
   },
 
   {
-    {"p18f442", "18f442", "pic18f442", "f442"},
-    (memRange *)NULL,
-    (memRange *)NULL,
+    {"p18f442", "18f442", "pic18f442", "f442"},                // aliases
     0,
-    0x300,
+    0x300,                                             // bank mask
+    0x300,                                             // RAMsize
+    0
   },
 
   {
-    {"p18f452", "18f452", "pic18f452", "f452"},
-    (memRange *)NULL,
-    (memRange *)NULL,
+    {"p18f452", "18f452", "pic18f452", "f452"},                // aliases
     0,
-    0x600,
+    0x600,                                             // bank mask
+    0x600,                                             // RAMsize
+    0
   },
 
-};
+  {
+    {"p18f248", "18f248", "pic18f248", "f248"},                // aliases
+    0,
+    0x300,                                             // bank mask
+    0x300,                                             // RAMsize
+    0
+  },
+
+  {
+    {"p18f258", "18f258", "pic18f258", "f258"},                // aliases
+    0,
+    0x600,                                             // bank mask
+    0x600,                                             // RAMsize
+    0
+  },
+
+  {
+    {"p18f448", "18f448", "pic18f448", "f448"},                // aliases
+    0,
+    0x300,                                             // bank mask
+    0x300,                                             // RAMsize
+    0
+  },
+
+  {
+    {"p18f458", "18f458", "pic18f458", "f458"},                // aliases
+    0,
+    0x600,                                             // bank mask
+    0x600,                                             // RAMsize
+    0
+  },
+
+  {
+    {"p18f6520", "18f6520", "pic18f6520", "f6520"},    // aliases
+    0,
+    0x800,                                             // bank mask
+    0x800,                                             // RAMsize
+    1
+  },
 
-static int num_of_supported_PICS = sizeof(Pics)/sizeof(PIC_device);
+  {
+    {"p18f6620", "18f6620", "pic18f6620", "f6620"},    // aliases
+    0,
+    0xf00,                                             // bank mask
+    0xf00,                                             // RAMsize
+    1
+  },
+  {
+    {"p18f6680", "18f6680", "pic18f6680", "f6680"},    // aliases
+    0,
+    0xc00,                                             // bank mask
+    0xc00,                                             // RAMsize
+    1
+  },
+  {
+    {"p18f6720", "18f6720", "pic18f6720", "f6720"},    // aliases
+    0,
+    0xf00,                                             // bank mask
+    0xf00,                                             // RAMsize
+    1
+  },
+  {
+    {"p18f8520", "18f8520", "pic18f8520", "f8520"},    // aliases
+    0,
+    0x800,                                             // bank mask
+    0x800,                                             // RAMsize
+    1
+  },
+  {
+    {"p18f8620", "18f8620", "pic18f8620", "f8620"},    // aliases
+    0,
+    0xf00,                                             // bank mask
+    0xf00,                                             // RAMsize
+    1
+  },
+  {
+    {"p18f8680", "18f8680", "pic18f8680", "f8680"},    // aliases
+    0,
+    0xc00,                                             // bank mask
+    0x800,                                             // RAMsize
+    1
+  },
+  {
+    {"p18f8720", "18f8720", "pic18f8720", "f8720"},    // aliases
+    0,
+    0xf00,                                             // bank mask
+    0xf00,                                             // RAMsize
+    1
+  },
 
-#define DEFAULT_PIC "f452"
+};
+
+static int num_of_supported_PICS = sizeof(Pics16)/sizeof(PIC16_device);
 
-static PIC_device *pic=NULL;
+#define DEFAULT_PIC "452"
 
-AssignedMemory *pic16_finalMapping=NULL;
+PIC16_device *pic16=NULL;
 
 #define DEFAULT_CONFIG_BYTE 0xff
 
@@ -125,193 +218,137 @@ static unsigned int config6h_word = DEFAULT_CONFIG6H_WORD;
 static unsigned int config7l_word = DEFAULT_CONFIG7L_WORD;
 static unsigned int config7h_word = DEFAULT_CONFIG7H_WORD;
 
-void pic16_addMemRange(memRange *r, int type)
-{
-  int i;
-  int alias = r->alias;
-
-  if (pic->maxRAMaddress < 0) {
-    fprintf(stderr, "missing \"#pragma maxram\" setting\n");
-    return;
-  }
+unsigned int stackPos = 0;
 
-  do {
-    for (i=r->start_address; i<= r->end_address; i++) {
-      if ((i|alias) <= pic->maxRAMaddress) {
-       pic16_finalMapping[i | alias].isValid = 1;
-       pic16_finalMapping[i | alias].alias = r->alias;
-       pic16_finalMapping[i | alias].bank  = r->bank;
-       if(type) {
-         /* hack for now */
-         pic16_finalMapping[i | alias].isSFR  = 1;
-       } else {
-         pic16_finalMapping[i | alias].isSFR  = 0;
-       }
-      } else {
-       fprintf(stderr, "WARNING: %s:%s memory at 0x%x is beyond max ram = 0x%x\n",
-               __FILE__,__FUNCTION__,(i|alias), pic->maxRAMaddress);
-      }
-    }
-
-    /* Decrement alias */
-    if (alias) {
-      alias -= ((alias & (alias - 1)) ^ alias);
-    } else {
-      alias--;
-    }
-
-  } while (alias >= 0);
-}
+extern regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alias, operand *refop);
 
 void pic16_setMaxRAM(int size)
 {
-  int i;
-  pic->maxRAMaddress = size;
+       pic16->maxRAMaddress = size;
+       stackPos = pic16->RAMsize-1;
 
-  if (pic->maxRAMaddress < 0) {
-    fprintf(stderr, "invalid \"#pragma maxram 0x%x\" setting\n",
-           pic->maxRAMaddress);
-    return;
-  }
-
-  pic16_finalMapping = Safe_calloc(1+pic->maxRAMaddress,
-                            sizeof(AssignedMemory));
+       if (pic16->maxRAMaddress < 0) {
+               fprintf(stderr, "invalid \"#pragma maxram 0x%x\" setting\n",
+                       pic16->maxRAMaddress);
+         return;
+       }
+}
 
-  /* Now initialize the pic16_finalMapping array */
+extern char *iComments2;
 
-  for(i=0; i<=pic->maxRAMaddress; i++) {
-    pic16_finalMapping[i].reg = NULL;
-    pic16_finalMapping[i].isValid = 0;
-  }
+void pic16_dump_equates(FILE *of, set *equs)
+{
+  regs *r;
+
+       r = setFirstItem(equs);
+       if(!r)return;
+       
+       fprintf(of, "%s", iComments2);
+       fprintf(of, ";\tEquates to used internal registers\n");
+       fprintf(of, "%s", iComments2);
+       
+       for(; r; r = setNextItem(equs)) {
+               fprintf(of, "%s\tequ\t0x%02x\n", r->name, r->address);
+       }
 }
 
-/*-----------------------------------------------------------------*
- *-----------------------------------------------------------------*/
 
-int pic16_isREGinBank(regs *reg, int bank)
+int regCompare(const void *a, const void *b)
 {
+  const regs *const *i = a;
+  const regs *const *j = b;
 
-  if(!reg || !pic)
-    return 0;
+       /* sort primarily by the address */
+       if( (*i)->address > (*j)->address)return 1;
+       if( (*i)->address < (*j)->address)return -1;
+       
+       /* and secondarily by size */
+       if( (*i)->size > (*j)->size)return 1;
+       if( (*i)->size < (*j)->size)return -1;
 
-  if(pic16_finalMapping[reg->address].bank == bank)
-    return 1;
 
   return 0;
 }
 
-/*-----------------------------------------------------------------*
- *-----------------------------------------------------------------*/
-int pic16_REGallBanks(regs *reg)
+void pic16_dump_section(FILE *of, set *section, int fix)
 {
+  static int abs_section_no=0;
+  regs *r, *rprev;
+  int init_addr, i;
+  regs **rlist;
+
+       /* put all symbols in an array */
+       rlist = Safe_calloc(elementsInSet(section), sizeof(regs *));
+       r = rlist[0]; i = 0;
+       for(rprev = setFirstItem(section); rprev; rprev = setNextItem(section)) {
+               rlist[i] = rprev; i++;
+       }
 
-  if(!reg || !pic)
-    return 0;
-
-  if (reg->address > pic->maxRAMaddress)
-    return 0;
-
-  return 1;
-
+       /* sort symbols according to their address */
+       qsort(rlist, elementsInSet(section), sizeof(regs *), regCompare);
+       
+       if(!i) {
+               if(rlist)free(rlist);
+         return;
+       }
+       
+       if(!fix) {
+               fprintf(of, "\n\n\tudata\n");
+               for(r = setFirstItem(section); r; r = setNextItem(section)) {
+                       fprintf(of, "%s\tres\t%d\n", r->name, r->size);
+               }
+       } else {
+         int j=0;
+                 
+               rprev = NULL;
+               init_addr = rlist[j]->address;
+               fprintf(of, "\n\nstatic_%s_%02d\tudata\t0X%04X\n", moduleName, abs_section_no++, init_addr);
+       
+               for(j=0;j<i;j++) {
+                       r = rlist[j];
+                       init_addr = r->address;
+                       if(rprev && (init_addr != (rprev->address + rprev->size))) {
+                               fprintf(of, "\nstatic_%s_%02d\tudata\t0X%04X\n", moduleName, abs_section_no++, init_addr);
+                       }
+
+                       fprintf(of, "%s\tres\t%d\n", r->name, r->size);
+                       rprev = r;
+               }
+       }
+       free(rlist);
 }
 
-/*-----------------------------------------------------------------*
- *-----------------------------------------------------------------*/
-
-/*
- *  pic16_dump_map -- debug stuff
- */
-
-void pic16_dump_map(void)
+void pic16_dump_int_registers(FILE *of, set *section)
 {
+  regs *r, *rprev;
   int i;
+  regs **rlist;
 
-  for(i=0; i<=pic->maxRAMaddress; i++) {
-    //fprintf(stdout , "addr 0x%02x is %s\n", i, ((pic16_finalMapping[i].isValid) ? "valid":"invalid"));
-
-    if(pic16_finalMapping[i].isValid) {
-      fprintf(stderr,"addr: 0x%02x",i);
-      if(pic16_finalMapping[i].isSFR)
-       fprintf(stderr," isSFR");
-      if(pic16_finalMapping[i].reg) 
-       fprintf( stderr, "  reg %s", pic16_finalMapping[i].reg->name);
-      fprintf(stderr, "\n");
-    }
-  }
-
-}
-
-void pic16_dump_cblock(FILE *of)
-{
-  int start=-1;
-  int addr=0;
-  int bank_base;
-
-  //pic16_dump_map();   /* display the register map */
-
-  if (pic->maxRAMaddress < 0) {
-    fprintf(stderr, "missing \"#pragma maxram\" setting\n");
-    return;
-  }
-
-  do {
-
-    if(pic16_finalMapping[addr].reg && !pic16_finalMapping[addr].reg->isEmitted) {
-
-      if(start<0)
-       start = addr;
-    } else {
-      if(start>=0) {
-
-       /* clear the lower 7-bits of the start address of the first
-        * variable declared in this bank. The upper bits for the mid
-        * range pics are the bank select bits.
-        */
-
-       bank_base = start & 0xfff8;
-
-       /* The bank number printed in the cblock comment tacitly
-        * assumes that the first register in the contiguous group
-        * of registers represents the bank for the whole group */
-
-        if ((pic16_finalMapping[start].bank == 0 && start <= 0x7f) ||
-            pic16_finalMapping[start].isSFR)
-         fprintf(of,"  cblock  0X%04X\t; Access Bank\n",start);
-        else
-         fprintf(of,"  cblock  0X%04X\t; Bank %d\n",start,pic16_finalMapping[start].bank);
-
-       for( ; start < addr; start++) {
-         if((pic16_finalMapping[start].reg) && !pic16_finalMapping[start].reg->isEmitted ) {
-           fprintf(of,"\t%s",pic16_finalMapping[start].reg->name);
-
-           /* If this register is aliased in multiple banks, then
-            * mangle the variable name with the alias address: */
-           if(pic16_finalMapping[start].alias & start)
-             fprintf(of,"_%x",bank_base);
-
-           if(pic16_finalMapping[start].instance)
-             fprintf(of,"_%d",pic16_finalMapping[start].instance);
-
-           
-           fputc('\n',of);
-
-           //pic16_finalMapping[start].reg->isEmitted = 1;
-         }
+       /* put all symbols in an array */
+       rlist = Safe_calloc(elementsInSet(section), sizeof(regs *));
+       r = rlist[0]; i = 0;
+       for(rprev = setFirstItem(section); rprev; rprev = setNextItem(section)) {
+               rlist[i] = rprev; i++;
        }
 
-       fprintf(of,"  endc\n");
-
-       start = -1;
-      }
-
-    }
-
-    addr++;
+       /* sort symbols according to their address */
+       qsort(rlist, elementsInSet(section), sizeof(regs *), regCompare);
+       
+       if(!i) {
+               if(rlist)free(rlist);
+         return;
+       }
+       
+       fprintf(of, "\n\n; Internal registers\n");
+       
+       fprintf(of, "%s\tudata_ovr\t0x0000\n", ".registers");
+       for(r = setFirstItem(section); r; r = setNextItem(section))
+               fprintf(of, "%s\tres\t%d\n", r->name, r->size);
+
+       free(rlist);
+}
 
-  } while(addr <= pic->maxRAMaddress);
-  
 
-}
 
 /*-----------------------------------------------------------------*
  *  void pic16_list_valid_pics(int ncols, int list_alias)
@@ -329,7 +366,7 @@ void pic16_list_valid_pics(int ncols, int list_alias)
   int i,j,k,l;
 
   if(list_alias)
-    list_alias = sizeof(Pics[0].name) / sizeof(Pics[0].name[0]);
+    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;
@@ -337,7 +374,7 @@ void pic16_list_valid_pics(int ncols, int list_alias)
   /* 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(Pics[i].name[j]);
+      k = strlen(Pics16[i].name[j]);
       if(k>longest)
        longest = k;
     }
@@ -349,9 +386,9 @@ void pic16_list_valid_pics(int ncols, int list_alias)
     j = 0;
     do {
 
-      fprintf(stderr,"%s", Pics[i].name[j]);
+      fprintf(stderr,"%s", Pics16[i].name[j]);
       if(col<ncols) {
-       l = longest + 2 - strlen(Pics[i].name[j]);
+       l = longest + 2 - strlen(Pics16[i].name[j]);
        for(k=0; k<l; k++)
          fputc(' ',stderr);
 
@@ -373,7 +410,7 @@ void pic16_list_valid_pics(int ncols, int list_alias)
 /*-----------------------------------------------------------------*
  *  
  *-----------------------------------------------------------------*/
-PIC_device *pic16_find_device(char *name)
+PIC16_device *pic16_find_device(char *name)
 {
 
   int i,j;
@@ -384,8 +421,8 @@ PIC_device *pic16_find_device(char *name)
   for(i = 0; i<num_of_supported_PICS; i++) {
 
     for(j=0; j<PROCESSOR_NAMES; j++)
-      if(!STRCASECMP(Pics[i].name[j], name) )
-       return &Pics[i];
+      if(!STRCASECMP(Pics16[i].name[j], name) )
+       return &Pics16[i];
   }
 
   /* not found */
@@ -397,21 +434,22 @@ PIC_device *pic16_find_device(char *name)
  *-----------------------------------------------------------------*/
 void pic16_init_pic(char *pic_type)
 {
-  pic = pic16_find_device(pic_type);
+       pic16 = pic16_find_device(pic_type);
 
-  if(!pic) {
-    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(!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");
+               fprintf(stderr,"Valid devices are:\n");
 
-    pic16_list_valid_pics(4,0);
-    exit(1);
-  }
+               pic16_list_valid_pics(4,0);
+               exit(1);
+       }
 
-  pic->maxRAMaddress = -1;
+//     printf("PIC processor found and initialized: %s\n", pic_type);
+       pic16_setMaxRAM( 0xfff  );
 }
 
 /*-----------------------------------------------------------------*
@@ -419,7 +457,7 @@ void pic16_init_pic(char *pic_type)
  *-----------------------------------------------------------------*/
 int pic16_picIsInitialized(void)
 {
-  if(pic && pic->maxRAMaddress > 0)
+  if(pic16 && pic16->maxRAMaddress > 0)
     return 1;
 
   return 0;
@@ -432,169 +470,65 @@ int pic16_picIsInitialized(void)
 char *pic16_processor_base_name(void)
 {
 
-  if(!pic)
+  if(!pic16)
     return NULL;
 
-  return pic->name[0];
-}
-
-static int isSFR(int address)
-{
-
-  if( (address > pic->maxRAMaddress) || !pic16_finalMapping[address].isSFR)
-    return 0;
-
-  return 1;
-
+  return pic16->name[0];
 }
 
-/*-----------------------------------------------------------------*
- *-----------------------------------------------------------------*/
-static int validAddress(int address, int reg_size)
-{
-  int i;
-
-  if (pic->maxRAMaddress < 0) {
-    fprintf(stderr, "missing \"#pragma maxram\" setting\n");
-    return 0;
-  }
-  //  fprintf(stderr, "validAddress: Checking 0x%04x\n",address);
-  if(address > pic->maxRAMaddress)
-    return 0;
-
-  for (i=0; i<reg_size; i++)
-    if(!pic16_finalMapping[address + i].isValid || 
-       pic16_finalMapping[address+i].reg ||
-       pic16_finalMapping[address+i].isSFR )
-      return 0;
-
-  return 1;
-}
-
-/*-----------------------------------------------------------------*
- *-----------------------------------------------------------------*/
-static void mapRegister(regs *reg)
-{
-
-  int i;
-  int alias;
-
-  if(!reg || !reg->size) {
-    fprintf(stderr,"WARNING: %s:%s:%d Bad register\n",__FILE__,__FUNCTION__,__LINE__);
-    return;
-  }
-
-  if (pic->maxRAMaddress < 0) {
-    fprintf(stderr, "missing \"#pragma maxram\" setting\n");
-    return;
-  }
-
-  for(i=0; i<reg->size; i++) {
-
-    alias = pic16_finalMapping[reg->address].alias;
-    reg->alias = alias;
-
-    do {
-
-      //fprintf(stdout,"mapping %s to address 0x%02x, reg size = %d\n",reg->name, (reg->address+alias+i),reg->size);
-
-      pic16_finalMapping[reg->address + alias + i].reg = reg;
-      pic16_finalMapping[reg->address + alias + i].instance = i;
 
-      /* Decrement alias */
-      if(alias)
-       alias -= ((alias & (alias - 1)) ^ alias);
-      else
-       alias--;
-
-    } while (alias>=0);
-  }
-
-  //  fprintf(stderr,"%s - %s addr = 0x%03x, size %d\n",__FUNCTION__,reg->name, reg->address,reg->size);
-
-  reg->isMapped = 1;
-
-}
-
-/*-----------------------------------------------------------------*
- *-----------------------------------------------------------------*/
-static int assignRegister(regs *reg, int start_address)
+/*
+ * return 1 if register wasn't found and added, 0 otherwise
+ */
+int checkAddReg(set **set, regs *reg)
 {
-  int i;
-
-  //fprintf(stderr,"%s -  %s start_address = 0x%03x\n",__FUNCTION__,reg->name, start_address);
-  if(reg->isFixed) {
-
-    if (validAddress(reg->address,reg->size)) {
-      //fprintf(stderr,"%s -  %s address = 0x%03x\n",__FUNCTION__,reg->name, reg->address);
-      mapRegister(reg);
-      return reg->address;
-    }
-
-    if( isSFR(reg->address)) {
-      mapRegister(reg);
-      return reg->address;
-    }
-
-    //fprintf(stderr, "WARNING: Ignoring Out of Range register assignment at fixed address %d, %s\n",
-    //    reg->address, reg->name);
+  regs *tmp;
 
-  } else {
 
-    /* This register does not have a fixed address requirement
-     * so we'll search through all availble ram address and
-     * assign the first one */
-
-    for (i=start_address; i<=pic->maxRAMaddress; i++) {
-
-      if (validAddress(i,reg->size)) {
-       reg->address = i;
-       mapRegister(reg);
-       return i;
-      }
-    }
-
-    fprintf(stderr, "WARNING: No more RAM available for %s\n",reg->name);
-
-  }
+       for(tmp = setFirstItem(*set); tmp; tmp = setNextItem(*set)) {
+               if(!strcmp(tmp->name, reg->name))break;
+       }
+       
+       if(!tmp) {
+               addSet(set, reg);
+               return 1;
+       }
 
-  return -1;
+  return 0;
 }
 
 /*-----------------------------------------------------------------*
+ * void pic16_groupRegistersInSection - add each register to its   *
+ *     corresponding section                                      *
  *-----------------------------------------------------------------*/
-void pic16_assignFixedRegisters(set *regset)
+void pic16_groupRegistersInSection(set *regset)
 {
   regs *reg;
 
-  for (reg = setFirstItem(regset) ; reg ; 
-       reg = setNextItem(regset)) {
-
-    if(reg->isFixed) 
-      assignRegister(reg,0);
-  }
-
+       for(reg=setFirstItem(regset); reg; reg = setNextItem(regset)) {
+               if(reg->wasUsed
+                       && !(reg->regop && SPEC_EXTR(OP_SYM_ETYPE(reg->regop)))) {
+
+//                     fprintf(stderr, "%s:%d register %s\n", __FILE__, __LINE__, reg->name);
+
+                       if(reg->alias) {
+                               checkAddReg(&pic16_equ_data, reg);
+                       } else
+                       if(reg->isFixed) {
+                               checkAddReg(&pic16_fix_udata, reg);
+                       } else
+                       if(!reg->isFixed) {
+                               if(reg->pc_type == PO_GPR_TEMP)
+                                       checkAddReg(&pic16_int_regs, reg);
+                               else
+                                       checkAddReg(&pic16_rel_udata, reg);
+                       }
+               }
+       }
 }
 
-/*-----------------------------------------------------------------*
- *-----------------------------------------------------------------*/
-void pic16_assignRelocatableRegisters(set *regset, int used)
-{
-
-  regs *reg;
-  int address = 0;
-
-  for (reg = setFirstItem(regset) ; reg ; 
-       reg = setNextItem(regset)) {
-
-    //fprintf(stdout,"assigning %s isFixed=%d, wasUsed=%d\n",reg->name,reg->isFixed,reg->wasUsed);
-
-    if((!reg->isFixed) && ( used || reg->wasUsed))
-      address = assignRegister(reg,address);
 
-  }
 
-}
 
 
 /*-----------------------------------------------------------------*
@@ -644,7 +578,7 @@ void pic16_assignConfigWordValue(int address, int value)
     break;
   }
 
-  //fprintf(stderr,"setting config word to 0x%x\n",value);
+       fprintf(stderr,"setting config word to 0x%x\n",value);
 
 }
 /*-----------------------------------------------------------------*
@@ -683,4 +617,3 @@ int pic16_getConfigWord(int address)
     return 0;
   }
 }
-