On 01/03/11 15:33, Colin O'Flynn wrote: > Hi Bob, > > One consideration is that reading or writing might have side-effects on a > memory-mapped peripheral. > > So if you were accessing a peripheral with a pointer to a volatile uint32_t, > and issue the |= command, you might actually be expecting the CPU to perform > the memory read & write. The simple act of reading the memory could clear a > flag for example. > > My personal thought process with the volatile keyword is I assume the > compiler does *all* memory accesses, even the unnecessary ones. > > Regards, > > -Colin Hi Colin, by this logic the missing 'OR' instructions could also affect external hardware as they are read-modify-write, but these are optimised away.
Cheers, Bob _______________________________________________ AVR-chat mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-chat
