I tried to monitor TF0 flag via simulator in Keil uVision. On step by step simulation it can be seen that till 0xFFFF Timer0 register is incrementing properly. But after 0xFFFF instead of 0x0000, 0x0004 is getting loaded on to Timer0 register ie. TH0 and TL0 and Flag is not setting