* src/pic16/ralloc.c: fix warnings
[fw/sdcc] / src / pic / device.c
index ee12eb5dd8a97b488d939fee5ffdf36cdff51b17..2a2cd646cf244135042eafb5bfba82eb14ac443a 100644 (file)
@@ -75,6 +75,14 @@ static PIC_device Pics[] = {
     0x180,
   },
 
+  {
+    {"p16f819", "16f819", "pic16f819", "f819"},
+    (memRange *)NULL,
+    (memRange *)NULL,
+    0,
+    0x80,
+  },
+
 };
 
 static int num_of_supported_PICS = sizeof(Pics)/sizeof(PIC_device);
@@ -203,14 +211,16 @@ void dump_map(void)
 
 }
 
-void dump_cblock(FILE *of)
+void dump_sfr(FILE *of)
 {
+
   int start=-1;
   int addr=0;
   int bank_base;
+  static int udata_flag=0;
 
   //dump_map();   /* display the register map */
-
+  //fprintf(stdout,";dump_sfr  \n");
   if (pic->maxRAMaddress < 0) {
     fprintf(stderr, "missing \"#pragma maxram\" setting\n");
     return;
@@ -236,29 +246,25 @@ void dump_cblock(FILE *of)
         * assumes that the first register in the contiguous group
         * of registers represents the bank for the whole group */
 
-       fprintf(of,"  cblock  0X%04X\t; Bank %d\n",start,finalMapping[start].bank);
+       if ( (start != addr) && (!udata_flag) ) {
+         udata_flag = 1;
+          //fprintf(of,"\tudata\n");
+       }
 
        for( ; start < addr; start++) {
-         if((finalMapping[start].reg) && !finalMapping[start].reg->isEmitted ) {
-           fprintf(of,"\t%s",finalMapping[start].reg->name);
+         if((finalMapping[start].reg) && 
+             (!finalMapping[start].reg->isEmitted) &&
+             (!finalMapping[start].instance) && 
+            (!finalMapping[start].isSFR)) {
 
-           /* If this register is aliased in multiple banks, then
-            * mangle the variable name with the alias address: */
-           if(finalMapping[start].alias & start)
-             fprintf(of,"_%x",bank_base);
+           fprintf(of,"%s\tres\t%i\n",
+                    finalMapping[start].reg->name, 
+                    finalMapping[start].reg->size);
 
-           if(finalMapping[start].instance)
-             fprintf(of,"_%d",finalMapping[start].instance);
-
-           
-           fputc('\n',of);
-
-           //finalMapping[start].reg->isEmitted = 1;
+           finalMapping[start].reg->isEmitted = 1;
          }
        }
 
-       fprintf(of,"  endc\n");
-
        start = -1;
       }
 
@@ -468,7 +474,7 @@ void mapRegister(regs *reg)
     } while (alias>=0);
   }
 
-  //  fprintf(stderr,"%s - %s addr = 0x%03x, size %d\n",__FUNCTION__,reg->name, reg->address,reg->size);
+  //fprintf(stderr,"%s - %s addr = 0x%03x, size %d\n",__FUNCTION__,reg->name, reg->address,reg->size);
 
   reg->isMapped = 1;
 
@@ -512,7 +518,7 @@ int assignRegister(regs *reg, int start_address)
       }
     }
 
-    fprintf(stderr, "WARNING: No more RAM available\n");
+    fprintf(stderr, "WARNING: No more RAM available for %s\n",reg->name);
 
   }