Hi all, i am using ST10. i like to know following thing. if someone having data for it please send. 1) How Clear Memory section logic of start166.a66 works. 2) Who initialized veriable ?C_CLRMEMSECSTART and how it get utilized in all logic? 3) Can i able to set fix address for ?C_CLRMEMSECSTART?
Regards... Yogesh.
Hi Joost Leeuwesteijn and All,
Nice feedback. It solved my various problem.
if i want to remove INITSEC and CLRMEMSEC from start166.a66 and place it in other C file (which i can able to locate at any address), then how i will go for it.
regards...
Yogesh.
Hi Yogesh,
Not sure why you would want to remove it from startup.a66. And it's assembly code so why do you want to put it in a C file?
You can still put the INITSEC and CLRMEMSEC at a different location when they're in startup.a66, or a seperate .a66 file if you really want to.
It's -really- part of the startup code so if you're absolutly sure you do want to put in a seperate file (for some reason), make sure you call it from startup.a66 and use all the settings (CLRMEM=1, etc.).
Wait, hang on... Is missed something. There's two things here: the SECTIONS and the assembly code that uses them. You can put the assembly code somewhere else (why?) but the sections are created by the linker, you can't define them somewhere else. The linker collects all the CLEAR and INIT variables and puts them in the INITSEC and CLRMEMSEC structure.
My startup.a66 contains:
EXTRN ?C_CLRMEMSECSTART : WORD
Which is the "link" to the CLRMEM section. This is how startup.a66 uses/knows it. Do a search on "C_CLRMEMSECSTART" in the map file (.m66) and notice that it says "LINKER GENERATED" (at least in my output).
Take a look again at: http://www.keil.com/support/man/docs/l166/l166_cinittab.htm
Isn't this what you're looking for? We are using a way-old dev kit in our project that doesn't have CINITTAB but I'm still able to use the SECTIONS() linker directive to put the sections where I want them:
SECTIONS( ; must be in ascending order ?C_INITSEC(0x030000), ?C_CLRMEMSEC )
Regards, Joost Leeuwesteijn