]> git.gag.com Git - fw/sdcc/commitdiff
* src/hc08/main.c (_hc08_genAssemblerPreamble): fixed bug #875487. Also
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 13 Jan 2004 03:54:11 +0000 (03:54 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 13 Jan 2004 03:54:11 +0000 (03:54 +0000)
changed interrupt vector table generation to only emit declared vectors.
* device/include/Makefile.in: added missing backslash
* device/lib/pic16/Makefile.rules: add $(MODELFLAGS) to $(CFLAGS)

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

ChangeLog
device/include/Makefile.in
src/hc08/main.c

index a24d711d599dff22a5dd68d87dc7a084c88e6b79..aeaa62591f2dc29e92d51059315bfeb7fa2aa76b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-13 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * src/hc08/main.c (_hc08_genAssemblerPreamble): fixed bug #875487. Also
+       changed interrupt vector table generation to only emit declared vectors.
+       * device/include/Makefile.in: added missing backslash
+       * device/lib/pic16/Makefile.rules: pass $(MODELFLAGS) to compiler
+
 2004-01-13 Vangelis Rokas <vrokas@otenet.gr>
 
        Mainly changes to support compilation of the device libraries
index 7c3d11a2a4f5e11087a257f0485e7bfefe44282c..42ead5267f9de63a361c786f2329394aeb2973ef 100644 (file)
@@ -43,7 +43,7 @@ install: all installdirs
        $(CP) -r asm *.h $(sdcc_includedir)
         if [ "`grep pic16 ../../ports.build`" = pic16 ]; then \
                 $(CP) pic16/*.h $(sdcc_includedir)/pic16 ; \
-        fi
+        fi \
        find $(sdcc_includedir) -type d -name 'CVS' -exec rm {} \;
 
 
index 938b8f8f51ebd4b6957c9921c2af2e6a5075dea1..c60408fc959a4857fb90964e1a2e3f33bdeb2443 100644 (file)
@@ -143,7 +143,8 @@ _hc08_getRegName (struct regs *reg)
 static void
 _hc08_genAssemblerPreamble (FILE * of)
 {
-   int i;
+  int i;
+  int needOrg = 1;
   symbol *mainExists=newSymbol("main", 0);
   mainExists->block=0;
 
@@ -161,22 +162,30 @@ _hc08_genAssemblerPreamble (FILE * of)
     {
       // generate interrupt vector table
       fprintf (of, "\t.area\tCODEIVT (ABS)\n");
-      fprintf (of, "\t.org\t0x%4x\n", (0xfffe - (maxInterrupts * 2)));
       
       for (i=maxInterrupts;i>0;i--)
         {
           if (interrupts[i])
-            fprintf (of, "\t.dw\t%s\n", interrupts[i]->rname);
+           {
+             if (needOrg)
+               {
+                 fprintf (of, "\t.org\t0x%04x\n", (0xfffe - (i * 2)));
+                 needOrg = 0;
+               }
+             fprintf (of, "\t.dw\t%s\n", interrupts[i]->rname);
+           }
           else
-            fprintf (of, "\t.dw\t0\n");
+           needOrg = 1;
         }
+      if (needOrg)
+       fprintf (of, "\t.org\t0xfffe\n");
       fprintf (of, "\t.dw\t%s", "__sdcc_gs_init_startup\n\n");
         
       fprintf (of, "\t.area GSINIT\n");
       fprintf (of, "__sdcc_gs_init_startup:\n");
       if (options.stack_loc)
         {
-          fprintf (of, "\tldhx\t#0x%4x\n", options.stack_loc+1);
+          fprintf (of, "\tldhx\t#0x%04x\n", options.stack_loc+1);
           fprintf (of, "\ttxs\n");
         }
       else
@@ -213,7 +222,7 @@ static void
 _hc08_genExtraAreas (FILE * asmFile, bool mainExists)
 {
     fprintf (asmFile, "%s", iComments2);
-    fprintf (asmFile, "; external ram data\n");
+    fprintf (asmFile, "; extended address mode data\n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, xdata->oFile);
 }
@@ -226,7 +235,7 @@ _hc08_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
   int i;
   
   fprintf (of, "\t.area\tCODEIVT (ABS)\n");
-  fprintf (of, "\t.org\t0x%4x\n",
+  fprintf (of, "\t.org\t0x%04x\n",
     (0xfffe - (maxInterrupts * 2)));
   
   for (i=maxInterrupts;i>0;i--)
@@ -234,7 +243,7 @@ _hc08_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
       if (interrupts[i])
         fprintf (of, "\t.dw\t%s\n", interrupts[i]->rname);
       else
-        fprintf (of, "\t.dw\t0\n");
+        fprintf (of, "\t.dw\t0xffff\n");
     }
   fprintf (of, "\t.dw\t%s", "__sdcc_gs_init_startup\n");