DCL_TYPE(ptr) = POINTER ;
break;
case S_CODE:
- DCL_PTR_CONST(ptr) = 1;
+ DCL_PTR_CONST(ptr) = port->mem.code_ro;
DCL_TYPE(ptr) = CPOINTER ;
break;
- case S_FLASH:
- DCL_TYPE(ptr) = FLPOINTER;
+ case S_EEPROM:
+ DCL_TYPE(ptr) = EEPPOINTER;
break;
default:
DCL_TYPE(ptr) = GPOINTER;
case PPOINTER:
case POINTER:
return ( PTRSIZE ) ;
- case FLPOINTER:
+ case EEPPOINTER:
case FPOINTER:
case CPOINTER:
return ( FPTRSIZE );
case PPOINTER:
case POINTER:
return ( PTRSIZE * 8) ;
- case FLPOINTER:
+ case EEPPOINTER:
case FPOINTER:
case CPOINTER:
return ( FPTRSIZE * 8);
/* global variables declared const put into code */
if (sym->level == 0 &&
- SPEC_SCLS(sym->etype) == S_CONSTANT)
+ SPEC_SCLS(sym->etype) == S_CONSTANT) {
SPEC_SCLS(sym->etype) = S_CODE ;
-
+ SPEC_CONST(sym->etype) = 1;
+ }
/* global variable in code space is a constant */
if (sym->level == 0 &&
- SPEC_SCLS(sym->etype) == S_CODE)
+ SPEC_SCLS(sym->etype) == S_CODE &&
+ port->mem.code_ro )
SPEC_CONST(sym->etype) = 1;
if (SPEC_SCLS(sym->etype) == S_CODE &&
sym->ival == NULL &&
!sym->level &&
+ port->mem.code_ro &&
!IS_EXTERN(sym->etype))
werror(E_CODE_NO_INIT,sym->name);
value *val ;
int pNum = 1;
+
/* if this function has variable argument list */
/* then make the function a reentrant one */
if (func->hasVargs)
func->args = NULL ;
return ;
}
-
+
+ /* reset regparm for the port */
+ (*port->reset_regparms)();
/* if any of the arguments is an aggregate */
/* change it to pointer to the same type */
while (val) {
/* mark it as a register parameter if
- the function does nit have VA_ARG
- and MAX_REG_PARMS not exceeded &&
+ the function does not have VA_ARG
+ and as port dictates
not inhibited by command line option or #pragma */
- if (pNum <= MAX_REG_PARMS &&
+ if (!func->hasVargs &&
!options.noregparms &&
- !func->hasVargs)
+ (*port->reg_parm)(val->type)) {
+
SPEC_REGPARM(val->etype) = 1;
+ }
if ( IS_AGGREGATE(val->type)) {
/* if this is a structure */
case S_XDATA:
DCL_TYPE(val->type) = FPOINTER;
break;
- case S_FLASH:
- DCL_TYPE(val->type) = FLPOINTER;
+ case S_EEPROM:
+ DCL_TYPE(val->type) = EEPPOINTER;
break;
default :
DCL_TYPE(val->type) = GPOINTER;
if (DCL_PTR_CONST(type))
fprintf(of,"const ");
break;
- case FLPOINTER:
- fprintf (of,"_flash * ");
+ case EEPPOINTER:
+ fprintf (of,"_eeprom * ");
if (DCL_PTR_CONST(type))
fprintf(of,"const ");
break;
case V_BIT:
fprintf(of,"bit {%d,%d}",SPEC_BSTR(type),SPEC_BLEN(type));
break;
+
+ default:
+ break;
}
}
type = type->next;
case PPOINTER:
fprintf (of,"DP,");
break;
- case FLPOINTER:
+ case EEPPOINTER:
fprintf (of,"DA,");
break;
case ARRAY :
fprintf (of,"DA%d,",DCL_ELEM(type));
break;
+ default:
+ break;
}
} else {
switch (SPEC_NOUN(type)) {
case V_BIT:
fprintf(of,"SB%d$%d",SPEC_BSTR(type),SPEC_BLEN(type));
break;
+
+ default:
+ break;
}
fputs(":",of);
if (SPEC_USIGN(type))
for (su = 0; su < 2; su++) {
if (tofrom) {
sprintf(buffer, "__fs2%s%s", ssu[su], sbwd[bwd]);
- __conv[tofrom][bwd][su] = funcOfType(buffer, __multypes[bwd][su], floatType, 2, options.float_rent);
+ __conv[tofrom][bwd][su] = funcOfType(buffer, __multypes[bwd][su], floatType, 1, options.float_rent);
}
else {
sprintf(buffer, "__%s%s2fs", ssu[su], sbwd[bwd]);
- __conv[tofrom][bwd][su] = funcOfType(buffer, floatType, __multypes[bwd][su], 2, options.float_rent);
+ __conv[tofrom][bwd][su] = funcOfType(buffer, floatType, __multypes[bwd][su], 1, options.float_rent);
}
}
}