Hello CrasyCat,
Thanks for your response.
I tried your suggestion, but this did not fix the over-write problem. However, after a bit more experimentation, I did find the apparent cause.
It would seem that, when an absolute address is specified for a variable, such as -
extern BlockStruct RAMBlock @RAMStart+8;
the linker suffers amnesia concerning that variable, and ignores its existence (apart from including it in the map file). However, if I declare the same variable without an absolue address, there is now no overlap of variables (as expected), but RAMBlock is in the wrong place, starting at 0x0080.
To fix this problem, I needed to alter the Z_RAM segment in the PRM file to -
Z_RAM = READ_WRITE 0x0088 TO 0x00FF;
The result of this was OK provided that RAMBlock was defined or declared before any other global variable. If I now implement your suggestion, on top of these changes, and the order of variable definition became non-critical.
To make accessible the 8 bytes of RAM, starting at 0x0080, I would need to define a further segment -
Z_RAM0 = READ_WRITE 0x0080 TO 0x0087;
Is this behaviour of the linker, with respect to variables having an absolute address, documented anywhere?
Regards,
Mac
Message Edited by bigmac on
2007-07-14 12:55 AM