From: johanknol Date: Sat, 9 Feb 2002 18:37:56 +0000 (+0000) Subject: work in progress X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=f2c8bc35bada5d802e8bbb6a62a7eaf2ed9de734;p=fw%2Fsdcc work in progress git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1913 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/as/xa51/xa_link.c b/as/xa51/xa_link.c index 8b1489d1..09185650 100644 --- a/as/xa51/xa_link.c +++ b/as/xa51/xa_link.c @@ -45,10 +45,15 @@ #include "xa_version.h" enum { - CSEG=0, + CSEG=1, DSEG, XSEG, BSEG, + XINIT, + XISEG, + GSINIT, + GSFINAL, + HOME, MAX_SEGMENTS }; @@ -58,10 +63,16 @@ struct SEGMENT { int start; int current; } segments[MAX_SEGMENTS]={ - {CSEG, "CSEG", 0, 0}, - {DSEG, "DSEG", 0, 0}, - {XSEG, "XSEG", 0, 0}, - {BSEG, "BSEG", 0, 0} + {0, "????", 0, 0}, + {CSEG, "CSEG", 0, 0}, + {DSEG, "DSEG", 0, 0}, + {XSEG, "XSEG", 0, 0}, + {BSEG, "BSEG", 0, 0}, + {XINIT, "XINIT", 0, 0}, + {XISEG, "XISEG", 0, 0}, + {GSINIT, "GSINIT", 0, 0}, + {GSFINAL, "GSFINAL", 0, 0}, + {HOME, "HOME", 0, 0}, }; char *libPaths[128]; @@ -71,6 +82,26 @@ int nlibFiles=0; static char outFileName[PATH_MAX]; +int currentArea=0; + +int getAreaID(char *area) { + int i; + for (i=1; inext) { - if (p->isdef && p->area==current_area) { - if (debug || p->name[strlen(p->name)-1]!='$') { - fprintf (frel, "S %s Def%04x\n", p->name, p->value); + if (area[current_area].size) { + fprintf (frel, "A %s size %d flags 0\n", + areaToString(current_area), + area[current_area].size); + if (!area[current_area].defsEmitted) { + for (p=sym_list; p; p=p->next) { + if (p->isdef && p->area==current_area) { + // skip temp labels + if (p->name[strlen(p->name)-1]!='$') { + fprintf (frel, "S %s Def%04x\n", p->name, p->value); + } } } + area[current_area].defsEmitted=1; } } last_area=current_area; @@ -401,7 +404,7 @@ void out(int *byte_list, int num) { current_area==AREA_GSFINAL || current_area==AREA_XINIT) { if (num) { - fprintf (frel, "T %02x %02x", (MEM_POS>>16)&0xff, MEM_POS&0xff); + fprintf (frel, "T %04x", MEM_POS); for (i=0; inext) { if (p->isdef) { - if (debug || p->name[strlen(p->name)-1]!='$') { + // skip temp labels, sfr and sbit + if (p->name[strlen(p->name)-1]!='$' && + p->area) { globals++; } }