On Fri, 21 Mar 2008 23:59:36 +0000 (GMT), "sergio masci" said: > > Also I think volatile declarations work the other way around and will > > not protect you from having to use a shadow register for the type of use > > you are putting it to. > > I would disagree. The way I understand "volatile" to work is that the > value of a variable may change so don't optimise it. > > When the change can occure is undefined. Therefore I would argue that > using it as a temporary location (as is being used here) is a violation. Interesting. I had thought that protection that way is not guaranteed, all that volatile did was prevent the compiler from assuming the variable has not changed simply because no nearby code changes it, so something like this: x = 0; while (x); wouldn't get optimized out. But I want to hear what Walter says. Cheerful regards, Bob -- http://www.fastmail.fm - A no graphics, no pop-ups email service -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist