[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Code Optimisation question re: volatile
From: |
Matthew Arcus |
Subject: |
Re: [avr-gcc-list] Code Optimisation question re: volatile |
Date: |
Fri, 23 Jul 2004 12:54:26 +0100 |
On Friday 23 July 2004 12:15 pm, D. Daniel McGlothin wrote:
> See Dennis Ritchie's C Reference Manual (May 1975)
> http://cm.bell-labs.com/cm/cs/who/dmr/cman.pdf, bottom of page 8.
>
> See Eric Huss's 1997 The C Library Reference Guide
> http://www.acm.uiuc.edu/webmonkeys/book/c_guide/ section 1.5.5.
>
> The two references differ as to the arrangement of the assignment and
> operator tokens.
Old C did have:
a =+ 10;
etc. but you had to be _very careful_ not to write eg.
a=&b;
where you meant:
a = &b;
(which is why it got changed I guess).
> In brief,
>
> pwm_state ^= _b00000011
>
> 'expands' to
>
> pwm_state = pwm_state ^ _b00000011
but, eg:
*p++ ^= 0xaa;
doesn't expand to:
*p++ = *p++ ^ 0xaa;
Matthew.
Re: [avr-gcc-list] Code Optimisation question re: volatile, E. Weddington, 2004/07/23