|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Doubt : Default value of Variables which are kept in NO_INIT locationhi everyone,
can any one tell me the initial default value for the varibles which are placed in the NO_INIT location by modifying the .prm file. I am using Codewarrior for this. I modifed my project .prm file, like below using NO_INIT, so that the variables which are declared in the RAM area from 0x2000 to 2005 will not be initialized to zero by default. when I download the code and debugging, I found it carries a max value by default initially. (i.e if I declare a char variable, it carries a value of 254). That means, all the variables which are declared in this RAM area will carry their max values...? or is that 254 is any garbage value..? please provide me the answer.. /* non-paged RAM */ My_Ram_Non_Init = NO_INIT 0x2000 TO 0x2005; /* vairbles in this location will not be initialized to zero */ My_Ram = READ_WRITE 0x2006 TO 0x3FFF; Thanks & Regards Kasu |
|
|
Re: Doubt : Default value of Variables which are kept in NO_INIT locationHi Kasu,
Is this for a S12X? Variables allocated in NO_INIT segments are not written to by the startup code, therefore the values are either garbage, values written into it before or some otherwise by the hardware defined values. For RAM and after the power on startup, I would expect them to contain garbage. Daniel yadunandan kasu wrote: > hi everyone, > > can any one tell me the initial default value for the varibles > which are placed in the NO_INIT location by modifying the .prm file. I > am using Codewarrior for this. > > I modifed my project .prm file, like below using NO_INIT, so > that the variables which are declared in the RAM area from 0x2000 to > 2005 will not be initialized to zero by default. > > when I download the code and debugging, I found it carries a max > value by default initially. (i.e if I declare a char variable, it > carries a value of 254). > That means, all the variables which are declared in this RAM > area will carry their max values...? or is that 254 is any garbage > value..? > > please provide me the answer.. > > /* non-paged RAM */ > > My_Ram_Non_Init = NO_INIT 0x2000 TO 0x2005; /* vairbles in this > location will not be > initialized to zero */ > My_Ram = READ_WRITE 0x2006 TO 0x3FFF; > > > Thanks & Regards > Kasu > > > > > > Yahoo! Groups Links > > > > > |
|
|
Re: Doubt : Default value of Variables which are kept in NO_INIT locationHi Daniel,
I agree with you,^^ I think the all the variables defined in the NO_INIT location carries some garbage value. I checked by defining different variables in the NO_INIT locations in my project. Thank you very much~ Kasu Daniel Friederich <dfriederich@...> wrote: Hi Kasu, Is this for a S12X? Variables allocated in NO_INIT segments are not written to by the startup code, therefore the values are either garbage, values written into it before or some otherwise by the hardware defined values. For RAM and after the power on startup, I would expect them to contain garbage. Daniel yadunandan kasu wrote: > hi everyone, > > can any one tell me the initial default value for the varibles > which are placed in the NO_INIT location by modifying the .prm file. I > am using Codewarrior for this. > > I modifed my project .prm file, like below using NO_INIT, so > that the variables which are declared in the RAM area from 0x2000 to > 2005 will not be initialized to zero by default. > > when I download the code and debugging, I found it carries a max > value by default initially. (i.e if I declare a char variable, it > carries a value of 254). > That means, all the variables which are declared in this RAM > area will carry their max values...? or is that 254 is any garbage > value..? > > please provide me the answer.. > > /* non-paged RAM */ > > My_Ram_Non_Init = NO_INIT 0x2000 TO 0x2005; /* vairbles in this > location will not be > initialized to zero */ > My_Ram = READ_WRITE 0x2006 TO 0x3FFF; > > > Thanks & Regards > Kasu > > > > > > Yahoo! Groups Links > > > > > regards Yadunandan Kasu(Nandu) --------------------------------- Now you can chat without downloading messenger. Click here to know how. [Non-text portions of this message have been removed] |
| Free embeddable forum powered by Nabble | Forum Help |