From: Michael P. <mic...@jk...> - 2001-12-12 14:28:37
|
Bernhard Held wrote: >>2. if you have memory mapped peripherials in XRAM. To use it you have to >>use something like >>xdata at 0xdead Byte foo; >>if there are also variables in XRAM there is also a hole between. or >>even worse the variables may overlap >> >I don't understand, why this kind of "hole" is so interesting. I've the >feeling you find the answers to your questions in the memory map of your >hardware and not in the map-file of sdcc. >I agree, that addresses accessed by "abolute addressing" could be better >documented in the map file. May be you want to dig into the source of >asx8051 and/or aslink and develope some enhancements ... > the hole is not interesting, but if I have an variable overlap the things go interesting. I'm sorry for the inconvenience, but I realy haven't found the hint in the doc that I have to ensure that there is no overlap. But maybe someday the size of the declared absolut addressed variable would be printed in the map file, this must be done in the C compiler because asm doesn't have any idea about typedefs and arrays. > >>look at my example. the array test is automatical located at 0x0000 and >>occupies 200 bytes. >>the memory mapped variables foo, goo and foofighter are absolute >>addressed at 0x0010, 0x0011 and 0x0012. >>you see this variable overlap with each other and the test array. >> > >>From the documentation: > >Note that this feature is provided to give the programmer access to >memory mapped devices attached to the controller. The compiler does not >actually reserve >any space for variables declared in this way (they are implemented with an >equate >in the assembler). Thus it is left to the programmer to make sure there are >no overlaps >with other variables that are declared without the absolute address. > >If you abuse this feature, don't blame the compiler or linker. > >Bernhard > > > >_______________________________________________ >Sdcc-user mailing list >Sdc...@li... >https://lists.sourceforge.net/lists/listinfo/sdcc-user > > |