Hello,
a friend of me had a look wednesday at the listings and had also disassembled the hex files to see if a starang thing was on the startup part. And after about two hours He as found THE PROBLEM.
For the working program, timer test is like this :
46 1EF l7
47 ;main.c: 63: do {} while (TMR0 != 0);
48 1EF 064 clrf 4
49 1F0 201 movf 1,w ;volatile
50 1F1 743 btfss 3,2
51 1F2 BEF goto l7
For the bad code, it is :
152 1ED l470:
153 1ED 221 movf 1,f
154 1EE 743 skipz
155 1EF BED goto l470
They write the reg 1 (tmr0) on itself to position flags. It does not change timer content if it runs slowly, but when the timer is written the prescaler IS RESET so it stays equal to 00 !!!
VERY BAD COMPILER