2006-03-22 03:34 PM
2006-03-21 11:42 PM
Micro used - ST7FL35
Compiler used - Cosmic Memory Model used - Medium Memory Model Is there a way to store the end address of the .share region generated in a variable? Learning this value from the linker file did not help. I had given like below in my linker file and expected _share to hold the end address of the .share region but it did not help +def __share=@.share # end of share segment Regards, Suganya :)2006-03-22 12:34 AM
it should work.
Of course it also depends on where and how you use it; if that's in crtsx, make sure that this file is the first in the list of the files to be linked (as I answered in the thread about crtsx and the bss address). Regards, Luca2006-03-22 12:47 AM
Luca,
As said i am acessing it in the crtsx file and it is first in the list of the files to be linked, but i get __share assigned with the start value of the share region instead of the end address. Any suggestions ??? -Suganya2006-03-22 03:41 AM
Suganya,
sorry, my previous answer was too quick. The syntax you have tried works for ''normal'' segments, but not for the shared segment, as this segment is built by the linker and its start and end addresses are not yet known when the +def is evaluated. In order to get the end address of the .share segment, you can define an empty data segment, append it to the .share and use that address instead: In the linker file: .... +seg .share -a iram -n share -is # shared segment +seg .prova -a share # empty segment .... +def __endshare=@.prova In the initialisaton file: ... xref.b c_x, c_y, __endzp, __endshare ... ld a,#__endshare ... I've just tried and it works as expected. Regards, Luca (Cosmic)2006-03-22 03:34 PM
Thank You !!!
It worked !!! -Suganya :D