Hi, my problem is rather theoretical, but I think it is interesting to others. Let's assume I want to access 16-bit register, for example ADC. I can use int a=ADC, and it works perfectly. I can use int a=ADCL | (ADCH<<8); and it should work ok if the compiler will not reorder the sequence of ADC readings. So my question is "“ according to C standard is it possible that optimizer will reorder the ADC read sequence, so ADCH will be read first and ruin ADC result?
Joined: Fri. Jan 10, 2003
Posts: 584 View posts