DSPRelated.com
Forums

Different value from same register?

Started by Hardeep October 26, 2005
Hi,

I am currently working with ESSI on the DSP56858. When I break in my
program and view the Status register (by looking at the Registers in
CodeWarrior), it appears that I am getting a different value from when
I break after copying the value of the Status register into a
variable. Does anyone know why I am receiving two different results
from the same register? Thanks.




Hi Hardeep,

Are you seeing register coloring? That is where when one variable is
not going to be used again, the register is used for another variable so
it appears as if the value changes when it just isn't relevant any
longer.

Try declaring the variable volatile that will prevent register coloring
if you need for it to show its value later on.

Ron

--
Ron Liechty
Ombudsman Freescale Developer Technology
ron.liechty@ron....

-----Original Message-----
Hardeep wrote:

Hi,

I am currently working with ESSI on the DSP56858. When I break in my
program and view the Status register (by looking at the Registers in
CodeWarrior), it appears that I am getting a different value from when
I break after copying the value of the Status register into a
variable. Does anyone know why I am receiving two different results
from the same register?