Make sure you are compiling with the corresponding PIC model (tarjet processor listbox) such in Microcode Studio and/or ICProg/Winpic800 or whatever program you use to burn your PIC,

I've seen many histories that begin with this common and trivial chapter...

example: your PIC is 16F877a, but your configuration says 16F84 (or other small memory pic)
solution: change tarjet processor to 16F877a

Hope it helped.