From: epetrich Date: Tue, 13 Jan 2004 03:54:11 +0000 (+0000) Subject: * src/hc08/main.c (_hc08_genAssemblerPreamble): fixed bug #875487. Also X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=270fddefec4feae4a03851b3fd06e8ea759fbd62;p=fw%2Fsdcc * 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: add $(MODELFLAGS) to $(CFLAGS) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3129 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index a24d711d..aeaa6259 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-01-13 Erik Petrich + + * 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 Mainly changes to support compilation of the device libraries diff --git a/device/include/Makefile.in b/device/include/Makefile.in index 7c3d11a2..42ead526 100644 --- a/device/include/Makefile.in +++ b/device/include/Makefile.in @@ -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 {} \; diff --git a/src/hc08/main.c b/src/hc08/main.c index 938b8f8f..c60408fc 100644 --- a/src/hc08/main.c +++ b/src/hc08/main.c @@ -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");