FAQ for PIC micros and Hi-Tech C
If a variable is not declared volatile, problems will arise if it is changed. This is because the optimiser makes the program store a temporary copy of the variable in a register. If the interrupt comes along and changes it, even though it is changed in ....