+2006-12-21 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * as/link/mcs51/lkarea.c (lnkarea2): handle absolute areas, restructured
+ BSEG handling,
+ (lnksect2): use --data-loc and --idata-loc as lower bound for ramstart,
+ corrected overlayed areax addresses, warn about memory overlaps
+ * as/mcs51/asmain.c (asmbl): create a new area for every .org directive
+ * src/avr/main.c,
+ * src/ds390/main.c,
+ * src/hc08/main.c,
+ * src/mcs51/main.c,
+ * src/pic16/main.c,
+ * src/pic/main.c,
+ * src/xa51/main.c,
+ * src/z80/main.c,
+ * src/port.h: added xabs_name and iabs_name
+ * src/SDCCglue.c (emitRegularMap): allocate for absolutes with initializer
+ (glue, emitMaps): create and emit maps d_abs and i_abs
+ * src/SDCCglue.h: cosmetic changes
+ * src/SDCCmain.c (setDefaultOptions): idata can start below 0x80
+ * src/SDCCmem.h,
+ * src/SDCCmem.c (initMem): added x_abs, i_abs and d_abs
+ (allocDefault): put absolute, initialized globals in them
+ * support/regression/tests/absolute.c: added absolute bdata test
+ * device/lib/printf_large.c (output_float): moved fpBuffer to stack/xdata
+
2006-12-20 Borut Razem <borut.razem AT siol.net>
* support/cpp2/cpphash.h, support/cpp2/cpplex.c: fixed bug #982435
char idatamap[256];
unsigned long codemap[524288];
unsigned long xdatamap[131072];
+struct area *dseg_ap = NULL;
+struct area *iseg_ap = NULL;
/*Modified version of the functions for packing variables in internal data memory*/
VOID lnkarea2 (void)
char temp[NCPS];
struct sym *sp;
int j;
- struct area *dseg_ap = NULL;
+ struct area *bseg_ap = NULL;
struct area *abs_ap = NULL;
struct area *gs0_ap = NULL;
struct sym *sp_dseg_s=NULL, *sp_dseg_l=NULL;
/* next accumulate all GSINITx/GSFINAL area sizes
into GSINIT so they stay together */
ap = areap;
+ abs_ap = areap;
while (ap)
{
+ if (ap->a_flag & A_ABS)
+ {
+ abs_ap = ap; /* Remember the last abs area */
+ }
if (!strncmp(ap->a_id, "GS", 2))
{/* GSxxxxx area */
if (ap->a_size == 0)
gs0_ap = ap;
}
}
+ /*Since area BSEG is defined just before BSEG_BYTES, use the bit size of BSEG
+ to compute the byte size of BSEG_BYTES: */
+ else if (!strcmp(ap->a_id, "BSEG"))
+ {
+ bseg_ap = ap->a_ap; //BSEG_BYTES
+ for (axp=ap->a_axp; axp; axp=axp->a_axp)
+ ap->a_size += axp->a_size;
+ bseg_ap->a_axp->a_size = ((ap->a_addr + ap->a_size + 7)/8); /*Bits to bytes*/
+ ap->a_ap = bseg_ap->a_ap; //removed BSEG_BYTES from list
+ bseg_ap->a_ap = abs_ap->a_ap;
+ abs_ap->a_ap = bseg_ap; //inserted BSEG_BYTES after abs
+ bseg_ap = ap; //BSEG
+ }
+ else if (!strcmp(ap->a_id, "DSEG"))
+ {
+ dseg_ap = ap; /*Need it later*/
+ }
+ else if (!strcmp(ap->a_id, "ISEG"))
+ {
+ iseg_ap = ap; /*Need it later*/
+ }
ap = ap->a_ap;
}
if (gs0_ap)
rloc[locIndex] = lnksect2(ap, locIndex);
}
+ if (!strcmp(ap->a_id, "BSEG_BYTES"))
+ {
+ bseg_ap->a_addr = (ap->a_axp->a_addr - 0x20) * 8; /*Bytes to bits*/
+ }
/*
* Create symbols called:
* s_<areaname> the start address of the area
*temp = 's';
sp = lkpsym(temp, 1);
- sp->s_addr = ap->a_addr ;
+ sp->s_addr = ap->a_addr;
sp->s_type |= S_DEF;
if (!strcmp(ap->a_id, "DSEG")) sp_dseg_s=sp;
if (!strcmp(ap->a_id, "DSEG")) sp_dseg_l=sp;
}
- /*Since area BSEG is defined just before BSEG_BYTES, use the bit size of BSEG
- to compute the byte size of BSEG_BYTES: */
- if (!strcmp(ap->a_id, "BSEG"))
- {
- ap->a_ap->a_axp->a_size = ((ap->a_addr + ap->a_size + 7)/8); /*Bits to bytes*/
- }
- else if (!strcmp(ap->a_id, "DSEG"))
- {
- dseg_ap=ap; /*Need it later to set its correct size*/
- }
ap = ap->a_ap;
}
{
register Addr_T size, addr;
register struct areax *taxp;
- int j, k, ramlimit;
+ int j, k, ramlimit, ramstart;
char fchar=' ', dchar='a';
char ErrMsg[]="?ASlink-Error-Could not get %d consecutive byte%s"
" in internal RAM for area %s.\n";
/*Notice that only ISEG and SSEG can be in the indirectly addressable internal RAM*/
if( (!strcmp(tap->a_id, "ISEG")) || (!strcmp(tap->a_id, "SSEG")) )
{
- if((iram_size<=0)||(iram_size>0x100))
- ramlimit=0x100;
+ if (iseg_ap)
+ ramstart = iseg_ap->a_addr;
else
- ramlimit=iram_size;
+ ramstart = 0;
+
+ if ((iram_size <= 0) || (ramstart + iram_size > 0x100))
+ ramlimit = 0x100;
+ else
+ ramlimit = ramstart + iram_size;
}
else
{
- if((iram_size<=0)||(iram_size>0x80))
- ramlimit=0x80;
+ if (dseg_ap)
+ ramstart = dseg_ap->a_addr;
+ else
+ ramstart = 0;
+
+ if ((iram_size <= 0) || (ramstart + iram_size > 0x80))
+ ramlimit = 0x80;
else
- ramlimit=iram_size;
+ ramlimit = ramstart + iram_size;
}
size = 0;
{
while (taxp)
{
+ if(taxp->a_size == 0)
+ {
+ taxp = taxp->a_axp;
+ continue;
+ }
+
if ( (fchar=='0')||(fchar=='1')||(fchar=='2')||(fchar=='3') ) /*Reg banks*/
{
addr=(fchar-'0')*8;
taxp->a_addr=addr;
size=taxp->a_size;
- for(j=addr; (j<(int)(addr+taxp->a_size)) && (j<ramlimit); j++)
+ for(j=addr; (j<(int)(addr+size)) && (j<ramlimit); j++)
idatamap[j]=fchar;
}
else if( (fchar=='S') || (fchar=='Q') ) /*Overlay and stack in internal RAM*/
{
/*Find the size of the space currently used for this areax overlay*/
- for(j=0, size=0; j<ramlimit; j++)
+ for(j=ramstart, size=0; j<ramlimit; j++)
if(idatamap[j]==fchar) size++;
if( (fchar=='S') && (stacksize==0) )
{
/*Search for the largest space available and use it for stack*/
- for(j=0, k=0, taxp->a_size=0; j<ramlimit; j++)
+ for(j=ramstart, k=0, taxp->a_size=0; j<ramlimit; j++)
{
if(idatamap[j]==' ')
{
- if((++k)>(int)taxp->a_size) taxp->a_size=k;
+ if((++k)>(int)taxp->a_size)
+ taxp->a_size=k;
}
else
{
{
size=(int)taxp->a_size;
- for(j=0; j<ramlimit; j++)
+ for(j=ramstart; j<ramlimit; j++)
if(idatamap[j]==fchar) idatamap[j]=' ';
/*Search for a space large enough in data memory for this overlay areax*/
- for(j=0, k=0; j<ramlimit; j++)
+ for(j=ramstart, k=0; j<ramlimit; j++)
{
if(idatamap[j]==' ')
k++;
else
k=0;
- if(k==(int)taxp->a_size) break;
- }
-
if(k==(int)taxp->a_size)
- {
- taxp->a_addr = j-k+1;
- if(addr<(unsigned int)ramlimit)
- {
- for(j=ramlimit-1; (j>=0)&&(idatamap[j]==' '); j--);
- if(j>=0) addr=j+1;
- }
+ break;
}
/*Mark the memory used for overlay*/
if(k==(int)taxp->a_size)
{
- for(j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<ramlimit); j++)
+ addr = j-k+1;
+ for(j=addr; (j<(int)(addr+size)); j++)
idatamap[j]=fchar;
-
- /*Set the new size of the data memory area*/
- size=ramlimit-addr;
}
else /*Couldn't find a chunk big enough: report the problem.*/
{
lkerr++;
}
}
-
- for(j=0; j<ramlimit; j++)
- {
- if (idatamap[j]==fchar)
- {
- addr=j;
- tap->a_addr=addr;
- taxp->a_addr=addr;
- break;
- }
- }
}
else if (fchar=='T') /*Bit addressable bytes in internal RAM*/
{
/*Find the size of the space currently used for this areax overlay*/
- for(j=0x20, size=0; j<0x30; j++)
- if(idatamap[j]==fchar) size++;
+// for(j=0x20, size=0; j<0x30; j++)
+// if(idatamap[j]==fchar) size++;
/*If more space required, release the previously allocated areax in
internal RAM and search for a bigger one*/
k++;
else
k=0;
- if(k==(int)taxp->a_size) break;
- }
-
- if(k==(int)taxp->a_size)
- {
- taxp->a_addr = j-k+1;
- if(addr<(unsigned int)0x30)
- {
- for(j=0x2F; (j>=0x20)&&(idatamap[j]==' '); j--);
- if(j>=0x20) addr=j+1;
- }
+ if(k==(int)taxp->a_size)
+ break;
}
/*Mark the memory used for overlay*/
- if(k==(int)taxp->a_size)
+ if(k==(int)size)
{
- for(j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<0x30); j++)
+ addr = j-k+1;
+ for(j=addr; (j<(int)(addr+size)); j++)
idatamap[j]=fchar;
-
- /*Set the new size of the data memory area*/
- size=ramlimit-addr;
}
else /*Couldn't find a chunk big enough: report the problem.*/
{
lkerr++;
}
}
-
- for(j=0x20; j<0x30; j++)
- {
- if (idatamap[j]==fchar)
- {
- addr=j;
- tap->a_addr=addr;
- taxp->a_addr=addr;
- break;
- }
- }
}
else /*Overlay areas not in internal ram*/
{
}
taxp = taxp->a_axp;
}
+ /*Now set all overlayed areax to the same start address*/
+ taxp = tap->a_axp;
+ while (taxp)
+ {
+ taxp->a_addr = addr;
+ taxp = taxp->a_axp;
+ }
}
else if (tap->a_flag & A_ABS) /* Absolute sections */
{
{
if (locIndex == 0)
{
- for (j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<ramlimit); j++)
- idatamap[j] = 'A';
+ for (j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<256); j++)
+ {
+ if (idatamap[j] == ' ')
+ idatamap[j] = 'A';
+ else
+ fprintf(stderr, "memory overlap at 0x%X for %s\n", j, tap->a_id);
+ }
}
- if (locIndex == 1)
+ else if (locIndex == 1)
{
allocate_space(taxp->a_addr, taxp->a_size, tap->a_id, codemap);
}
- if (locIndex == 2)
+ else if (locIndex == 2)
{
allocate_space(taxp->a_addr, taxp->a_size, tap->a_id, xdatamap);
}
if(taxp->a_size)
{
/*Search for a space large enough in internal RAM for this areax*/
- for(j=0, k=0; j<ramlimit; j++)
+ for(j=ramstart, k=0; j<ramlimit; j++)
{
if(idatamap[j]==' ')
k++;
else
k=0;
- if(k==(int)taxp->a_size) break;
+ if(k==(int)taxp->a_size)
+ break;
}
if(k==(int)taxp->a_size)
{
taxp->a_addr = j-k+1;
- if(addr<(unsigned int)ramlimit)
- {
- for(j=ramlimit-1; (j>=0)&&(idatamap[j]==' '); j--);
- if(j>=0) addr=j+1;
- size=ramlimit-addr;
- }
+
+ size += taxp->a_size;
for(j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<ramlimit); j++)
idatamap[j]=(fchar=='D')?dchar:fchar;
{
if(taxp->a_size!=0)
{
- for(j=addr; j<((int)(addr+taxp->a_size)); j++)
+ /*Search for a space large enough in data memory for this areax*/
+ for(j=0x20, k=0; j<0x30; j++)
+ {
+ if(idatamap[j]==' ')
+ k++;
+ else
+ k=0;
+ if(k==(int)taxp->a_size) break;
+ }
+
+ /*Mark the memory used*/
+ if(k==(int)taxp->a_size)
+ {
+ taxp->a_addr = j-k+1;
+ for(j=taxp->a_addr; (j<(int)(taxp->a_addr+taxp->a_size)) && (j<0x30); j++)
idatamap[j]=fchar;
+ }
+ else /*Couldn't find a chunk big enough: report the problem.*/
+ {
+ tap->a_unaloc=taxp->a_size;
+ fprintf(stderr, ErrMsg, taxp->a_size, taxp->a_size>1?"s":"", tap->a_id);
+ lkerr++;
+ }
}
-
- taxp->a_addr = addr;
- addr += taxp->a_size;
size += taxp->a_size;
taxp = taxp->a_axp;
}
char fn[PATH_MAX];
char *p;
int d, n, uaf, uf;
+ static struct area *abs_ap; /* pointer to current absolute area structure */
laddr = dot.s_addr;
lmode = SLIST;
}
newdot(ap);
lmode = SLIST;
+ if (dot.s_area->a_flag & A_ABS)
+ abs_ap = ap;
break;
case S_ORG:
if (dot.s_area->a_flag & A_ABS) {
- outall();
- dot.s_area->a_size += dot.s_addr - dot.s_org;
- laddr = dot.s_addr = dot.s_org = absexpr();
+ char buf[NCPS];
+ laddr = absexpr();
+ sprintf(buf, "%s%x", abs_ap->a_id, laddr);
+ if ((ap = alookup(buf)) == NULL) {
+ ap = (struct area *) new (sizeof(struct area));
+ *ap = *areap;
+ ap->a_ap = areap;
+ strncpy(ap->a_id, buf, NCPS);
+ ap->a_ref = areap->a_ref + 1;
+ ap->a_size = 0;
+ ap->a_fuzz = 0;
+ areap = ap;
+ }
+ newdot(ap);
+ lmode = ALIST;
+ dot.s_addr = dot.s_org = laddr;
} else {
err('o');
}
- outall();
- lmode = ALIST;
break;
case S_RADIX:
pfn_outputchar output_char, void* p)
{
unsigned char charsOutputted = 0;
+ char fpBuffer[128];
#else
#define OUTPUT_FLOAT(F, W, D, L, Z, S, P) output_float(F, W, D, L, Z, S, P)
static void
signed char reqDecimals,
BOOL left, BOOL zero, BOOL sign, BOOL space)
{
+ xdata char fpBuffer[128];
#endif //SDCC_STACK_AUTO
BOOL negative = 0;
unsigned long integerPart;
float decimalPart;
- char fpBuffer[128];
char fpBI=0, fpBD;
unsigned char minWidth, i;
/* if it has an initial value then do it only if
it is a global variable */
if (sym->ival && sym->level == 0) {
- if (SPEC_OCLS(sym->etype)==xidata) {
+ if ((SPEC_OCLS(sym->etype)==xidata) && !SPEC_ABSA (sym->etype)) {
/* create a new "XINIT (CODE)" symbol, that will be emitted later
in the static seg */
newSym=copySymbol (sym);
printIval (sym, sym->type, sym->ival, tmpFile);
noAlloc--;
}
-
- sym->ival=NULL;
} else {
if (IS_AGGREGATE (sym->type)) {
ival = initAggregates (sym, sym->ival, NULL);
allocInfo = 1;
}
}
- sym->ival = NULL;
}
/* if it has an absolute address then generate
an equate for this no need to allocate space */
- if (SPEC_ABSA (sym->etype))
+ if (SPEC_ABSA (sym->etype) && !sym->ival)
{
char *equ="=";
if (options.debug) {
if (options.debug) {
fprintf (map->oFile, "==.\n");
}
+ if (SPEC_ABSA (sym->etype))
+ {
+ tfprintf (map->oFile, "\t!org\n", SPEC_ADDR (sym->etype));
+ }
if (IS_STATIC (sym->etype) || sym->level)
tfprintf (map->oFile, "!slabeldef\n", sym->rname);
else
tfprintf (map->oFile, "!labeldef\n", sym->rname);
- tfprintf (map->oFile, "\t!ds\n",
- (unsigned int) size & 0xffff);
+ tfprintf (map->oFile, "\t!ds\n", (unsigned int) size & 0xffff);
}
+ sym->ival = NULL;
}
}
data, idata & bit & xdata */
emitRegularMap (data, TRUE, TRUE);
emitRegularMap (idata, TRUE, TRUE);
+ emitRegularMap (d_abs, TRUE, TRUE);
+ emitRegularMap (i_abs, TRUE, TRUE);
emitRegularMap (bit, TRUE, TRUE);
emitRegularMap (pdata, TRUE, TRUE);
emitRegularMap (xdata, TRUE, TRUE);
copyFile (asmFile, idata->oFile);
}
+ /* create the absolute idata/data segment */
+ if ( (i_abs) && (mcs51_like) ) {
+ fprintf (asmFile, "%s", iComments2);
+ fprintf (asmFile, "; absolute internal ram data\n");
+ fprintf (asmFile, "%s", iComments2);
+ copyFile (asmFile, d_abs->oFile);
+ copyFile (asmFile, i_abs->oFile);
+ }
+
/* copy the bit segment */
if (mcs51_like) {
fprintf (asmFile, "%s", iComments2);
extern set *tmpfileNameSet;
void rm_tmpfiles (void);
-int
-pointerTypeToGPByte (const int p_type, const char *iname, const char *oname);
+int pointerTypeToGPByte (const int p_type, const char *iname, const char *oname);
#endif
options.code_loc = 0; /* code starts at 0 */
options.data_loc = 0; /* JCF: By default let the linker locate data */
options.xdata_loc = 0;
- options.idata_loc = 0x80;
+ options.idata_loc = 0; /* MB: No need to limit idata to 0x80-0xFF */
options.nopeep = 0;
options.model = port->general.default_model;
options.nostdlib = 0;
}
/* if the extention is type .rel or .r or .REL or .R
- addtional object file will be passed to the linker */
+ additional object file will be passed to the linker */
if (strcmp (fext, ".r") == 0 || strcmp (fext, ".rel") == 0 ||
strcmp (fext, ".R") == 0 || strcmp (fext, ".REL") == 0 ||
strcmp (fext, port->linker.rel_ext) == 0)
memmap *bit = NULL; /* bit addressable space */
memmap *statsg = NULL; /* the constant data segment */
memmap *c_abs = NULL; /* constant absolute data */
+memmap *x_abs = NULL; /* absolute xdata/pdata */
+memmap *i_abs = NULL; /* absolute idata upto 256 */
+memmap *d_abs = NULL; /* absolute data upto 128 */
memmap *sfr = NULL; /* register space */
memmap *reg = NULL; /* register space */
memmap *sfrbit = NULL; /* sfr bit space */
DEBUG-NAME - 'C'
POINTER-TYPE - CPOINTER
*/
- home = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME, 'C', CPOINTER);
+ home = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, HOME_NAME, 'C', CPOINTER);
/* Static segment (code for variables );
SFRSPACE - NO
*/
data = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME, 'E', POINTER);
+ /* Absolute internal storage segment ;
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - YES
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'E'
+ POINTER-TYPE - POINTER
+ */
+ if (IABS_NAME) {
+ d_abs = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, IABS_NAME, 'E', POINTER);
+ } else {
+ d_abs = NULL;
+ }
+
/* overlay segment - same as internal storage segment ;
SFRSPACE - NO
FAR-SPACE - NO
idata=NULL;
}
+ /* Indirectly addressed absolute internal segment
+ SFRSPACE - NO
+ FAR-SPACE - NO
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - NO
+ DEBUG-NAME - 'E'
+ POINTER-TYPE - IPOINTER
+ */
+ if (IABS_NAME) {
+ i_abs = allocMap (0, 0, 0, 0, 0, 0, options.data_loc, IABS_NAME, 'E', IPOINTER);
+ } else {
+ i_abs = NULL;
+ }
+
/* Bit space ;
SFRSPACE - NO
FAR-SPACE - NO
if (sym->_isparm)
return FALSE;
/* if code change to constant */
- if (sym->ival && (sym->level==0) && SPEC_ABSA(sym->etype)) {
+ if (sym->ival && (sym->level==0) && SPEC_ABSA (sym->etype)) {
SPEC_OCLS(sym->etype) = c_abs;
} else {
SPEC_OCLS (sym->etype) = statsg;
case S_XDATA:
// should we move this to the initialized data segment?
if (port->genXINIT &&
- sym->ival && (sym->level==0) && !SPEC_ABSA(sym->etype)) {
+ sym->ival && (sym->level==0) && !SPEC_ABSA (sym->etype)) {
SPEC_OCLS(sym->etype) = xidata;
} else {
SPEC_OCLS (sym->etype) = xdata;
}
break;
case S_DATA:
- SPEC_OCLS (sym->etype) = data;
+ /* absolute initialized global */
+ if (sym->ival && (sym->level==0) && SPEC_ABSA (sym->etype)) {
+ SPEC_OCLS(sym->etype) = d_abs;
+ } else {
+ SPEC_OCLS (sym->etype) = data;
+ }
break;
case S_IDATA:
- SPEC_OCLS (sym->etype) = idata;
+ /* absolute initialized global */
+ if (sym->ival && (sym->level==0) && SPEC_ABSA (sym->etype)) {
+ SPEC_OCLS(sym->etype) = i_abs;
+ } else {
+ SPEC_OCLS (sym->etype) = idata;
+ }
sym->iaccess = 1;
break;
case S_PDATA:
#define OVERLAY_NAME port->mem.overlay_name
#define CONST_NAME port->mem.const_name
#define CABS_NAME port->mem.cabs_name
+#define XABS_NAME port->mem.xabs_name
+#define IABS_NAME port->mem.iabs_name
/* forward definition for variables */
extern memmap *xstack; /* xternal stack data */
extern memmap *bit; /* bit addressable space */
extern memmap *statsg; /* static code segment */
extern memmap *c_abs; /* constant absolute data */
+extern memmap *x_abs; /* absolute xdata/pdata */
+extern memmap *i_abs; /* absolute idata upto 256 */
+extern memmap *d_abs; /* absolute data upto 128 */
extern memmap *sfr; /* register space */
extern memmap *sfrbit; /* sfr bit space */
extern memmap *reg; /* register space */
extern memmap *generic; /* unknown */
extern memmap *overlay; /* the overlay segment */
-extern memmap *eeprom; /* eepromp space */
-extern memmap *eeprom; /* eepromp space */
+extern memmap *eeprom; /* eeprom space */
extern memmap *home; /* Non-banked home space */
extern int fatalError;
"HOME",
NULL, // initialized xdata
NULL, // a code copy of xiseg
- "CONST (CODE)", // const_name - const data (code or not)
+ "CONST (CODE)", // const_name - const data (code or not)
+ "CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata/pdata
+ "IABS (ABS,DATA)", // iabs_name - absolute idata/data
NULL,
NULL,
0,
"XINIT (CODE)", // a code copy of xiseg
"CONST (CODE)", // const_name - const data (code or not)
"CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata/pdata
+ "IABS (ABS,DATA)", // iabs_name - absolute idata/data
NULL,
NULL,
1
NULL,
"CONST (CODE)", // const_name - const data (code or not)
"CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata/pdata
+ "IABS (ABS,DATA)", // iabs_name - absolute idata/data
NULL,
NULL,
1
"XINIT (CODE)", // a code copy of xiseg
"CONST (CODE)", // const_name - const data (code or not)
"CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata/pdata
+ "IABS (ABS,DATA)", // iabs_name - absolute idata/data
NULL,
NULL,
1
"HOME (CODE)",
"XISEG", // initialized xdata
"XINIT", // a code copy of xiseg
- "CONST (CODE)", // const_name - const data (code or not)
+ "CONST (CODE)", // const_name - const data (code or not)
"CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS)", // xabs_name - absolute xdata
+ "IABS (ABS)", // iabs_name - absolute data
NULL,
NULL,
1
"XINIT (CODE)", // xinit_name - a code copy of xiseg
"CONST (CODE)", // const_name - const data (code or not)
"CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata/pdata
+ "IABS (ABS,DATA)", // iabs_name - absolute idata/data
NULL,
NULL,
1
NULL, // xinit
"CONST (CODE)", // const_name - const data (code or not)
"CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata
+ "IABS (ABS,DATA)", // iabs_name - absolute data
NULL,
NULL,
1 // code is read only
NULL, // xinit
"CONST (CODE)", // const_name - const data (code or not)
"CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata
+ "IABS (ABS,DATA)", // iabs_name - absolute data
NULL, // default location for auto vars
NULL, // default location for global vars
1 // code is read only 1=yes
/* definition of builtin functions */
typedef struct builtins
{
- char *name; /* name of builtin function */
- char *rtype; /* return type as string : see typefromStr */
- int nParms; /* number of parms : max 8 */
+ char *name; /* name of builtin function */
+ char *rtype; /* return type as string : see typefromStr */
+ int nParms; /* number of parms : max 8 */
char *parm_types[MAX_BUILTIN_ARGS]; /* each parm type as string : see typeFromStr */
} builtins;
const char *xinit_name; // a code copy of xidata
const char *const_name; // const data (code or not)
const char *cabs_name; // const absolute data (code or not)
+ const char *xabs_name; // absolute xdata/pdata
+ const char *iabs_name; // absolute idata/data
struct memmap *default_local_map; // default location for auto vars
struct memmap *default_globl_map; // default location for globl vars
int code_ro; /* code space read-only 1=yes */
"XINIT (CODE)", // a code copy of xiseg
"CONST (CODE)", // const_name - const data (code or not)
"CABS (ABS,CODE)", // cabs_name - const absolute data (code or not)
+ "XABS (ABS,XDATA)", // xabs_name - absolute xdata
+ "IABS (ABS,DATA)", // iabs_name - absolute data
NULL, // default local map
NULL, // default global map
1
NULL, /* xinit */
NULL, /* const_name */
"CABS", /* cabs_name */
+ NULL, /* xabs_name */
+ NULL, /* iabs_name */
NULL,
NULL,
1
NULL, /* xinit */
NULL, /* const_name */
"CABS", /* cabs_name */
+ NULL, /* xabs_name */
+ NULL, /* iabs_name */
NULL,
NULL,
1
ASSERT(pI[0] == 0x1234);\r
#endif\r
}\r
+\r
+#if defined(SDCC_mcs51) || defined(SDCC_ds390)\r
+volatile data at(0x20) unsigned char Byte0 = 0x00;\r
+volatile data at(0x22) unsigned char Byte1 = 0x00;\r
+volatile bit Bit0, Bit1, Bit2, Bit3, Bit4, Bit5, Bit6, Bit7, Bit8;\r
+#endif\r
+\r
+void\r
+testAbsBdata(void)\r
+{\r
+#if defined(SDCC_mcs51) || defined(SDCC_ds390)\r
+ Bit0 = 1;\r
+ ASSERT(Byte0 == 0x00);\r
+ Byte0 = 0xFF;\r
+ Bit0 = 0;\r
+ ASSERT(Byte0 == 0xFF);\r
+#endif\r
+}\r