Forums

setting zero as initial value for C code in CCS

Started by ahma...@yahoo.com May 5, 2008
Hi;
I have written a source code and tested it in visual C but when I built and ran it on C64DSK it did not work properly. I understood that its fault was due to the initial values for my general and static variables in code; In visual C all of these variables are set to zero but I don't know how can I set all of my variables and arrays in Code Composer to have zero value as initial value. Could you help me?

REGARDS
Hi,

In CCS, all the global and static variables are also initialize to zero.
As i see, by defalut you are assuming all the temp variables and general
purpose variables are also zero.
Which does not work always .... Because all thses variables store into
Stack.

You have to initialize all the valiables which goes to stack to zero
manually.

The otherway to cross check, you can reset to your statck memory to zero
before executing the program.
Be careful, about initial few address ....still it is not gurentee that your
program will work properly.

Hope, you got your answer.
Please revert me back if you need any other help.

Regards,
Sandip

On 5/5/08, a...@yahoo.com wrote:
>
> Hi;
> I have written a source code and tested it in visual C but when I built and
> ran it on C64DSK it did not work properly. I understood that its fault was
> due to the initial values for my general and static variables in code; In
> visual C all of these variables are set to zero but I don't know how can I
> set all of my variables and arrays in Code Composer to have zero value as
> initial value. Could you help me?
>
> REGARDS