This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Clear Memory section of start166.a66

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.

Parents
  • 1) I can't remember where but I read something about it. It's a block of memory that contains memory locations and their size that have to be cleared. Same for the INIT section, which also contains the data that it has to be initialized with.

    2) It's used by startup.a66. My startup.a66 contains CLR_MEMORY=1 and INIT_VARS=1 that enable some assembly code that reads the CLRMEMSECSTART and INIT sections to clear or initialize that data/variables.

    This code is essential for your C files that use zero-initialized or pre-initialized code (int i; -> i is cleared to 0 using the CLEAR section ; int i=5; -> i is initialized to 5 using the INIT section). If you use #pragma noinit, the variable is -not- listed in the CLEAR section and does not get initialized to 0.

    3) http://www.keil.com/support/man/docs/l166/l166_cinittab.htm

    or perhaps the SECTIONS directive.

    If you look at the clear and init routines in startup.a66 you might be able to understand what the assembly does, it's not that much code.

    I can't help you with external documentation with more info about the structure of the sections.

    Regards,
    Joost Leeuwesteijn

Reply
  • 1) I can't remember where but I read something about it. It's a block of memory that contains memory locations and their size that have to be cleared. Same for the INIT section, which also contains the data that it has to be initialized with.

    2) It's used by startup.a66. My startup.a66 contains CLR_MEMORY=1 and INIT_VARS=1 that enable some assembly code that reads the CLRMEMSECSTART and INIT sections to clear or initialize that data/variables.

    This code is essential for your C files that use zero-initialized or pre-initialized code (int i; -> i is cleared to 0 using the CLEAR section ; int i=5; -> i is initialized to 5 using the INIT section). If you use #pragma noinit, the variable is -not- listed in the CLEAR section and does not get initialized to 0.

    3) http://www.keil.com/support/man/docs/l166/l166_cinittab.htm

    or perhaps the SECTIONS directive.

    If you look at the clear and init routines in startup.a66 you might be able to understand what the assembly does, it's not that much code.

    I can't help you with external documentation with more info about the structure of the sections.

    Regards,
    Joost Leeuwesteijn

Children
No data