| ??? 03/25/02 14:07 Read: times |
#21136 - RE: Is RAM initializing necessary ?? |
"Is it necessary to initialize/reset the RAM bytes to have a value of 00xh starting before the codes starts??"
No, it is not necessary; however, it is essential that you ensure that your variable contains a valid value before you use it! Utilities like lint, and many compilers, will warn you of "uninitialised" variables. "Routine_1 comes first in the code where the byte has to be zero or the result would corrupt." In that case, you the programmer must ensure that it is zero - whether by specifically initialising it in your code, or by having a general start-up process which clears all your RAM. "I never got rid of the problem untill I made the byte zero before the Routine_1." See above: if a routine requires a certain value to work correctly, you must make sure that it gets that value - otherwise, by definition, it won't work, will it?! "I was assuming that the RAM bytes are supposed to contain zeros at the power up." A totally unwarranted assumption! If you're a 'C' programmer, this may appear to be the case - but that's only because the 'C' runtime support does the initialisation for you! |
| Topic | Author | Date |
| Is RAM initializing necessary ?? | 01/01/70 00:00 | |
| RE: Is RAM initializing necessary ?? | 01/01/70 00:00 | |
| RE: Is RAM initializing necessary ?? | 01/01/70 00:00 | |
RE: Is RAM initializing necessary ?? | 01/01/70 00:00 |



