set *sectSyms=NULL; /* list of symbols set in a specific section */
set *wparamList=NULL;
+#if 0
+/* This is an experimental code for #pragma inline
+ and is temporarily disabled for 2.5.0 release */
set *asmInlineMap=NULL;
+#endif /* 0 */
struct {
unsigned ignore: 1;
regs *reg;
symbol *sym;
+ if (!stackPosS) {
+ fprintf (stderr, "%s:%d: #pragma stack [stack-pos] [stack-length] -- stack-position missing\n", filename, lineno-1);
+
+ return 0; /* considered an error */
+ }
+
stackPosVal = constVal( stackPosS );
stackPos = (unsigned int)floatFromVal( stackPosVal );
}
// fprintf(stderr, "Initializing stack pointer at 0x%x len 0x%x\n", stackPos, stackLen);
-
+
+ /* check sanity of stack */
+ if ((stackPos >> 8) != ((stackPos+stackLen) >> 8)) {
+ fprintf (stderr, "%s:%u: warning: stack [0x%03X,0x%03X] crosses memory bank boundaries (not fully tested)\n",
+ filename,lineno-1, stackPos, stackPos+stackLen-1);
+ }
+
+ if (pic16) {
+ if (stackPos < pic16->acsSplitOfs) {
+ fprintf (stderr, "%s:%u: warning: stack [0x%03X, 0x%03X] intersects with the access bank [0x000,0x%03x] -- this is highly discouraged!\n",
+ filename, lineno-1, stackPos, stackPos+stackLen-1, pic16->acsSplitOfs);
+ }
+
+ if (stackPos+stackLen > 0xF00 + pic16->acsSplitOfs) {
+ fprintf (stderr, "%s:%u: warning: stack [0x%03X,0x%03X] intersects with special function registers [0x%03X,0xFFF]-- this is highly discouraged!\n",
+ filename, lineno-1, stackPos, stackPos+stackLen-1, 0xF00 + pic16->acsSplitOfs);
+ }
+
+ if (stackPos+stackLen > pic16->RAMsize) {
+ fprintf (stderr, "%s:%u: error: stack [0x%03X,0x%03X] is placed outside available memory [0x000,0x%03X]!\n",
+ filename, lineno-1, stackPos, stackPos+stackLen-1, pic16->RAMsize-1);
+ exit(-1);
+ return 1; /* considered an error, but this reports "invalid pragma stack"... */
+ }
+ }
+
reg=newReg(REG_SFR, PO_SFR_REGISTER, stackPos, "_stack", stackLen-1, 0, NULL);
addSet(&pic16_fix_udata, reg);
absSym *absS;
value *addr;
+ if (!symname || !location) {
+ fprintf (stderr, "%s:%d: #pragma code [symbol] [location] -- symbol or location missing\n", filename, lineno-1);
+ exit (-1);
+ return 1; /* considered an error, but this reports "invalid pragma code"... */
+ }
+
absS = Safe_calloc(1, sizeof(absSym));
sprintf(absS->name, "_%s", symname);
sectName *snam;
int found=0;
+ if (!symname || !sectname) {
+ fprintf (stderr, "%s:%d: #pragma udata [section-name] [symbol] -- section-name or symbol missing!\n", filename, lineno-1);
+ exit (-1);
+ return 1; /* considered an error, but this reports "invalid pragma code"... */
+ }
+
while(symname) {
ssym = Safe_calloc(1, sizeof(sectSym));
ssym->name = Safe_calloc(1, strlen(symname)+2);
return 0;
}
-
+
+#if 0
+ /* This is an experimental code for #pragma inline
+ and is temporarily disabled for 2.5.0 release */
if(startsWith(ptr, "inline")) {
char *tmp = strtok((char *)NULL, WHITECOMMA);
return 0;
}
-
+#endif /* 0 */
+
return 1;
}