On Tue, 01 Mar 2011 06:56:53 -0500
"Graham Davies" <[email protected]> wrote:

> bob wrote:
> 
> 
> > ... The code is very simple (runs in Port Change interrupt):
> >
> >    if ((PINA & _BV(A2DDATA)) != 0)
> > result |= 0x80000000;
> >
> >    result >>= 1;
> 
> How is result declared?  Are you using the volatile qualifier?  If
> so, that would explain why the compiler feels obliged to load and
> store the entire 32 bits.
> 
> Graham.

I'm no expert but since the data is in RAM I can't see why the compiler
think it need to load and store the three lower bytes. If the variable
was in external registers on a bus, yes, since there could be some
effect on hardware connected to the strobes.

But again, I'm no expert.
/Janne

> 
> 
> 
> _______________________________________________
> AVR-chat mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/avr-chat

_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to