At the location "??????????" I want to call the DisplayData() after a specific clock period, for example after every 1000 clocks. is it possible to set the timer0 of 89c51 for this purpose.
Answer is yes. You can use timer0 for this purpose. Set the timer0's interrupt to count for the desired delay. i.e if you want to
have an interrupt every 1000 cycles, the delay for 1000 cpu cycles will be, lets say using a crystal of 11.0592MHz, = 0.361us * 1000 = 361us.
then you can use logic like this: