DSPRelated.com
Forums

Linker AutoInitialization Problem

Started by Yeo Han Kwang November 22, 2002
Hi, me again.

I'm developing using 6711DSK w/ CCS2.0 on WinNT.

The CCS gives three options for linker auto initialization.
I've get problem when compiling with any of them.

1) Load time auto initialization
An outer "for" loop in one of my procedures executes infinitely
because the (integer) counter resets to zero when it reaches the end
value of the loop :(

2) Run time auto initialization
A 2nd level "for" loop in my main program executes infinitely because
the counter resets midway through the loop :(
(The problem mentioned in 1 disappears.)

3) No auto initialization
My global variables are not initialized.
e.g. when i declare:
double 2PI = 3.14xxx + 3.14xxx;
The value is not 6.28xxx when I view it in the watch window. The
value of 2PI is a very small number x.xxx...e-3x



Hi, replying to myself again.

The reseting loop counters are caused by the linker allocating
overlapping addresses for the counter and my array data. Why it does
so? I don't know.

Still haven't figure out the un-initializabilty of global variables :
(

Yeo Han Kwang

--- In c6x@y..., "Yeo Han Kwang" <snoopyeo@y...> wrote:
> Hi, me again.
>
> I'm developing using 6711DSK w/ CCS2.0 on WinNT.
>
> The CCS gives three options for linker auto initialization.
> I've get problem when compiling with any of them.
>
> 1) Load time auto initialization
> An outer "for" loop in one of my procedures executes infinitely
> because the (integer) counter resets to zero when it reaches the
end
> value of the loop :(
>
> 2) Run time auto initialization
> A 2nd level "for" loop in my main program executes infinitely
because
> the counter resets midway through the loop :(
> (The problem mentioned in 1 disappears.)
>
> 3) No auto initialization
> My global variables are not initialized.
> e.g. when i declare:
> double 2PI = 3.14xxx + 3.14xxx;
> The value is not 6.28xxx when I view it in the watch window. The
> value of 2PI is a very small number x.xxx...e-3x