Thanks a ton....for such a nice code.
I have got the logic required from your code.
Now the concept is quite clear to me.
Moreover i would request you to provide me with some links where i can download the free version of compiler, linker, hex generator for PIC ...I desperately need one...