memmap *idata = NULL; /* internal data upto 256 */
memmap *bit = NULL; /* bit addressable space */
memmap *statsg = NULL; /* the constant data segment */
+memmap *c_abs = NULL; /* constant absolute data */
memmap *sfr = NULL; /* register space */
memmap *reg = NULL; /* register space */
memmap *sfrbit = NULL; /* sfr bit space */
*/
statsg = allocMap (0, 1, 0, 0, 0, 1, 0, STATIC_NAME, 'D', CPOINTER);
+ /* Constant Absolute Data segment (for variables );
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACCESS - YES
+ DEBUG-NAME - 'D'
+ POINTER-TYPE - CPOINTER
+ */
+ c_abs = allocMap (0, 1, 0, 0, 0, 1, 0, CABS_NAME, 'D', CPOINTER);
+
/* Data segment - internal storage segment ;
SFRSPACE - NO
FAR-SPACE - NO
{
memmap *segment = SPEC_OCLS (sym->etype);
addSet (&segment->syms, sym);
+ if (segment == pdata)
+ sym->iaccess = 1;
}
/*-----------------------------------------------------------------*/
if (sym->_isparm)
return FALSE;
/* if code change to constant */
- SPEC_OCLS (sym->etype) = statsg;
+ if (sym->ival && (sym->level==0) && SPEC_ABSA(sym->etype)) {
+ SPEC_OCLS(sym->etype) = c_abs;
+ } else {
+ SPEC_OCLS (sym->etype) = statsg;
+ }
break;
case S_XDATA:
// should we move this to the initialized data segment?
}
/* if this is a bit variable and no storage class */
- if (SPEC_NOUN (sym->etype) == V_BIT
- /*&& SPEC_SCLS (sym->etype) == S_BIT*/)
+ if (IS_SPEC(sym->type) && SPEC_NOUN (sym->type) == V_BIT)
+ /*&& SPEC_SCLS (sym->etype) == S_BIT*/
{
- SPEC_OCLS (sym->etype) = bit;
+ SPEC_OCLS (sym->type) = bit;
allocIntoSeg (sym);
return;
}
for (lval = val; lval; lval = lval->next, pNum++)
{
-
/* check the declaration */
checkDecl (lval->sym, 0);
lval->sym->ismyparm = 1;
lval->sym->localof = currFunc;
-
/* if automatic variables r 2b stacked */
if (options.stackAuto || IFFUNC_ISREENT (currFunc->type))
{
-
if (lval->sym)
lval->sym->onStack = 1;
continue;
}
- /* otherwise depending on the memory model
- note here that we put it into the overlay segment
- first, we will remove it from the overlay segment
- after the overlay determination has been done */
- if (options.model == MODEL_SMALL)
- {
- SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) =
- (options.noOverlay ? port->mem.default_local_map
- : overlay);
- }
- else
- {
- SPEC_SCLS (lval->etype) = S_XDATA;
- SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = xdata;
- }
+ /* otherwise depending on the memory model */
+ SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) =
+ port->mem.default_local_map;
+ if (options.model == MODEL_SMALL)
+ {
+ /* note here that we put it into the overlay segment
+ first, we will remove it from the overlay segment
+ after the overlay determination has been done */
+ if (!options.noOverlay)
+ {
+ SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) =
+ overlay;
+ }
+ }
+ else if (options.model == MODEL_MEDIUM)
+ {
+ SPEC_SCLS (lval->etype) = S_PDATA;
+ }
+ else
+ {
+ SPEC_SCLS (lval->etype) = S_XDATA;
+ }
allocIntoSeg (lval->sym);
}
}
-
return;
}
for (lval = val; lval; lval = lval->next)
{
-
/* unmark is myparm */
lval->sym->ismyparm = 0;
addSym (SymbolTab, lval->sym, lval->sym->name,
lval->sym->level, lval->sym->block, 1);
lval->sym->_isparm = 1;
- if (!isinSet (operKeyReset, lval->sym)) {
- addSet(&operKeyReset, lval->sym);
- }
+ if (!isinSet (operKeyReset, lval->sym))
+ {
+ addSet(&operKeyReset, lval->sym);
+ }
}
-
}
-
return;
}
void
allocLocal (symbol * sym)
{
-
/* generate an unique name */
SNPRINTF (sym->rname, sizeof(sym->rname),
"%s%s_%s_%d_%d",
}
/* if this is a bit variable and no storage class */
- if (SPEC_NOUN (sym->etype) == V_BIT
- && (SPEC_SCLS (sym->etype) == S_BIT))
+ if (IS_SPEC(sym->type) && SPEC_NOUN (sym->type) == V_BIT)
{
- SPEC_OCLS (sym->etype) = bit;
+ SPEC_SCLS (sym->type) = S_BIT;
+ SPEC_OCLS (sym->type) = bit;
allocIntoSeg (sym);
return;
}
- if (SPEC_SCLS (sym->etype) == S_DATA)
+ if ((SPEC_SCLS (sym->etype) == S_DATA) || (SPEC_SCLS (sym->etype) == S_REGISTER))
{
SPEC_OCLS (sym->etype) = (options.noOverlay ? data : overlay);
allocIntoSeg (sym);
overlay analysis has been done */
if (options.model == MODEL_SMALL) {
SPEC_OCLS (sym->etype) =
- (options.noOverlay ? port->mem.default_local_map
- : overlay);
+ (options.noOverlay ? port->mem.default_local_map : overlay);
} else {
SPEC_OCLS (sym->etype) = port->mem.default_local_map;
}