didier wrote:
 > Would'nt the "static" keyword take care of that?

i'm not sure how that would help.

 > 
 > Is it that you want to know where the variable resides, or
 > simply to make sure the memory space is not overlaid with
 > another variable?

well, it's never my intention to inadvertently use the same
memory location for two different variables.

and yes, i need to set the explicit location of large numbers
of variables which are sometimes accessed externally by a
host processor for debug and monitor purposes.

paul

 > 
 > Didier
 > 
 > -----Original Message-----
 > From: [EMAIL PROTECTED] 
 > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
 > Sent: Monday, August 18, 2008 10:09 AM
 > To: sdcc-user@lists.sourceforge.net
 > Subject: [Sdcc-user] laying out memory
 > 
 > i've recently discovered sdcc's (highly unusual :-) trick of letting two 
 > variables overlap, without much in the way of user warning.
 > 
 > i have variables in xdata on an 8051 that need to be "locked down" with 
 > something like:
 >   unsigned char at  GLOBAL_V_LOCATION+0x86 FooBar; it turns out that sdcc 
 > will 
 > happily reuse that location for its own purposes, as documented (thanks to 
 > frieder for pointing this
 > out):  "Thus it is left to the programmer to make sure there are no overlaps 
 > with other variables that are declared without the absolute address."  (took 
 > me 
 > quite a while to find this -- i consider this a bug in the linker.  at the 
 > least, the docs should have a more prominent "WARNING" at that point.)
 > 
 > the obvious workaround is to tell the linker that xdata lives in a region 
 > not 
 > used by my "locked down" variables.  however, i really need to tell it about 
 > two separate sections -- the space in between needs to be locked down for 
 > "legacy" reasons.  (i can probably change this, but i'd much rather not.)
 > 
 > so i'd like to do something like:
 > 
 >     $(LD) --xram-loc-1 0xf400 --xram-size-1 256 --xram-loc-2 0xf800 \
 >         --xram-size-2 256
 > 
 > is the sdcc linker capable of this?
 > 
 > 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
 > 
 > -------------------------------------------------------------------------
 > 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

=---------------------
 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

Reply via email to