- area[AREA_CSEG].alloc_position = 0;
- area[AREA_DSEG].alloc_position = 0x30;
- area[AREA_OSEG].alloc_position = 0x80;
- area[AREA_ISEG].alloc_position = 0;
- area[AREA_BSEG].alloc_position = 0;
- area[AREA_XSEG].alloc_position = 0;
- area[AREA_XISEG].alloc_position = 0;
- area[AREA_GSINIT].alloc_position = 0;
- area[AREA_GSFINAL].alloc_position = 0;
- area[AREA_HOME].alloc_position = 0;
+ area[AREA_CSEG].start=area[AREA_CSEG].alloc_position = 0;
+ area[AREA_DSEG].start=area[AREA_DSEG].alloc_position = 0;
+ area[AREA_BSEG].start=area[AREA_BSEG].alloc_position = 0;
+ area[AREA_XSEG].start=area[AREA_XSEG].alloc_position = 0;
+ area[AREA_XISEG].start=area[AREA_XISEG].alloc_position = 0;
+ area[AREA_XINIT].start=area[AREA_XINIT].alloc_position = 0;
+ area[AREA_GSINIT].start=area[AREA_GSINIT].alloc_position = 0;
+ area[AREA_GSFINAL].start=area[AREA_GSFINAL].alloc_position = 0;
+ area[AREA_HOME].start=area[AREA_HOME].alloc_position = 0;
+}
+
+void relPrelude() {
+ //char buffer[132];
+ int i, areas=0, globals=0;
+ struct symbol *p;
+
+ fprintf (frel, "SDCCXA rel, version %1.1f\n", version);
+ for (i=1; i<NUM_AREAS; i++) {
+ if ((area[i].size=area[i].alloc_position-area[i].start)) {
+ areas++;
+ }
+ }
+ for (p=sym_list; p; p=p->next) {
+ if (p->isdef) {
+ // skip temp labels, sfr and sbit
+ if (p->name[strlen(p->name)-1]!='$' &&
+ p->area) {
+ globals++;
+ }
+ }
+ }
+ fprintf (frel, "H %d areas %d global symbols\n", areas, globals);
+ fprintf (frel, "M %s\n", modulename);
+ for (p=sym_list; p; p=p->next) {
+ if (!p->isdef) {
+ fprintf (frel, "S %s Ref0000\n", p->name);
+ }
+ }
+}
+
+void printVersion() {
+ printf("\nPaul's XA51 Assembler\n");
+ printf("Copyright 1997,2002 Paul Stoffregen\n\n");
+ printf("This program is free software; you can redistribute it\n");
+ printf("and/or modify it under the terms of the GNU General Public\n");
+ printf("License, Version 2, published by the Free Software Foundation\n\n");
+ printf("This program is distributed in the hope that it will be useful,\n");
+ printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
+ printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");