Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/21/04 19:34
Read: times


 
#67155 - optmizing from xdata to data

Hi all,

I started to optmize my application running on
80dsc400. My first step was to change frequently
used variables do data, since i´m using the Large
model (default xdata).
However my app is misbehaving when i change the
declaration:

unsigned int volatile k;
unsigned int volatile r;

to

unsigned int volatile data k;
unsigned int volatile data r;

I was unable to find the exact reason, but looks like
increment and/or comparisons starts to fail.
The above mentioned variables are globals and used
inside a interrupt handler to read from a simple
circular buffer.

void timer(void) small interrupt ISR_TIMER3
{
if(!(wr == rd ))
{
if(r == (unsigned int)(SIZE-1))
{
rd = (rd + (unsigned int)SIZE);
r = 0;
}

k = k + (unsigned int)1;
r = r + (unsigned int)1;
}
}

Im using k = k + (unsigned int)1; because
i´ve heard strange things about the
compiler already...

Am I missing something ?

Thanks a lot!

Wallace









List of 7 messages in thread
TopicAuthorDate
optmizing from xdata to data            01/01/70 00:00      
   RE: optmizing from xdata to data            01/01/70 00:00      
      RE: optmizing from xdata to data            01/01/70 00:00      
      RE: optmizing from xdata to data            01/01/70 00:00      
   RE: optmizing from xdata to data            01/01/70 00:00      
      RE: optmizing from xdata to data            01/01/70 00:00      
         RE: optmizing from xdata to data            01/01/70 00:00      

Back to Subject List