didier wrote: > Reusing the space occupied by a global variable would be very > bad indeed. Is it what is happening here?
yes. sorry i wasn't clear in my earliest mail. it happens because of the way sdcc treats "char at 0xf000 foo;". it apparently doesn't actually enter "foo" into the symbol table as a full-fledged symbol, but only assigns it a value. that leaves the space available (from the compiler's viewpoint) for some other variable. as maarten also said, sdcc _will_ enter the symbol (at least in some cases, i guess) if the declaration is initialized as in: "char at 0xf000 foo = 0;". i've been experimenting with that -- i need to put together a smaller test program, though. because i've been trying to keep our code somewhat compatible with Keil (which does "at" somewhat differently), all my declarations are wrapped in macros. in addition, i use the same file for the header and the actual declarations (also through the magic of macros). my first attempt at initializing the "locked down" variables involved adding yet more macro complexity, and when something else came up that was more important to work on, i backed it all out and left it for another day. so i haven't really finished that exploration. (if this ends up being the solution, i'll need to be sure no flash is allocated anywhere for the the initialization data. i can't afford the space.) paul =--------------------- paul fox, [EMAIL PROTECTED] ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user