}
if(ival) {
- setAstLineno(ival, sym->lineDef);
+ setAstFileLine (ival, sym->fileDef, sym->lineDef);
codeOutBuf = &statsg->oBuf;
GcurMemmap = statsg;
eBBlockFromiCode (iCodeFromAst (ival));
{
char buf[256];
- sprintf(buf, "LOW(%s)", name);
- pic16_emitDS(buf, ptype, p);
- sprintf(buf, "HIGH(%s)", name);
- pic16_emitDS(buf, ptype, p);
+ sprintf (buf, "LOW(%s)", name);
+ pic16_emitDS (buf, ptype, p);
+ sprintf (buf, "HIGH(%s)", name);
+ pic16_emitDS (buf, ptype, p);
}
/*-----------------------------------------------------------------*/
{
char buf[256];
- _pic16_printPointerType (iname, ptype, p);
+ _pic16_printPointerType (iname, ptype, p);
- switch( itype ) {
+ switch (itype)
+ {
+ case CPOINTER:
+ case FUNCTION:
+ sprintf (buf, "UPPER(%s)", iname);
+ pic16_emitDS (buf, ptype, p);
+ break;
+
+ case GPOINTER:
+ case POINTER:
+ sprintf (buf, "0x80");
+ pic16_emitDS (buf, ptype, p);
+ break;
+
+ /*
+ * FPOINTER and IPOINTER are not used in pic16 port
case FPOINTER:
- case CPOINTER:
- case GPOINTER:
- case FUNCTION:
- {
- sprintf(buf, "UPPER(%s)", iname);
- pic16_emitDS(buf, ptype, p);
- }; break;
- case POINTER:
case IPOINTER:
- sprintf(buf, "0x80");
- pic16_emitDS(buf, ptype, p);
- break;
- default:
- debugf("itype = %d\n", itype );
- assert( 0 );
+ */
+ default:
+ debugf ("itype = %d\n", itype );
+ assert (0);
}
- //pic16_flushDB(ptype, p); /* might break char* const arr[] = {...}; */
+ //pic16_flushDB(ptype, p); /* might break char* const arr[] = {...}; */
}
if (!(val = list2val (ilist))) {
// assuming a warning has been thrown
- val=constVal("0");
+ val = constCharVal (0);
}
if (val->type != type) {
if (!val) {
// an error has been thrown already
- val=constVal("0");
+ val = constCharVal (0);
}
if (IS_LITERAL(val->etype)) {
/* symbol doesn't have absolute address but has initial value */
dbuf_printf (&code->oBuf, "%s:\n", sym->rname);
+ ++noAlloc;
resolveIvalSym (sym->ival, sym->type);
pb = pic16_newpCodeChain(NULL, 'P',pic16_newpCodeCharP("; Starting pCode block for Ival"));
//fprintf(stderr, "%s:%d [2] generating init for label: %s\n", __FILE__, __LINE__, sym->rname);
pic16_printIval(sym, sym->type, sym->ival, 'p', (void *)pb);
pic16_flushDB('p', (void *)pb);
+ --noAlloc;
} else {
/* symbol doesn't have absolute address and no initial value */
static void
pic16initialComments (FILE * afile)
{
- initialComments (afile);
- fprintf (afile, "; PIC16 port for the Microchip 16-bit core micros\n");
- if(xinst)
- fprintf (afile, "; * Extended Instruction Set\n");
-
- if(pic16_mplab_comp)
- fprintf(afile, "; * MPLAB/MPASM/MPASMWIN/MPLINK compatibility mode enabled\n");
- fprintf (afile, iComments2);
-
- if(options.debug) {
- fprintf (afile, "\n\t.ident \"SDCC version %s #%s [pic16 port]%s\"\n",
- SDCC_VERSION_STR, getBuildNumber(), (!xinst?"":" {extended}") );
- }
+ initialComments (afile);
+ fprintf (afile, "; PIC16 port for the Microchip 16-bit core micros\n");
+ if (pic16_options.xinst) {
+ fprintf (afile, "; * Extended Instruction Set\n");
+ } // if
+
+ if (pic16_mplab_comp) {
+ fprintf(afile, "; * MPLAB/MPASM/MPASMWIN/MPLINK compatibility mode enabled\n");
+ } // if
+ fprintf (afile, iComments2);
+
+ if (options.debug) {
+ fprintf (afile, "\n\t.ident \"SDCC version %s #%s [pic16 port]%s\"\n",
+ SDCC_VERSION_STR, getBuildNumber(), (!pic16_options.xinst?"":" {extended}") );
+ } // if
}
int