I would like to thank you for mentioning that the hex file format might be the problem.
I have actually thought so before but I couldnt confirm that there are other hex file formats after some Internet Searches.
So what I did was to go to the options>output tab of the microc compiler. there I was able to change the output type to long hex file format.
after doing this, I was able to generate an hex file similar to the one from the assembly hex file and I was able to write the
newly generated 2896 bytes long hex file format hex file to the pic 16f877 microcontroller.
Both the old hex file and the newly generated long hex file format hex file worked correctly on proteus.
Now that the 16f877 has been programmed, the problem that came up was that although the code work in proteus
it doenst seem to work in real hardware. my reset logic level, Vcc and ground are all at the appropriate voltage.
I tried changing the crystal, the problem still persist and the crystal capacitors are well inserted.
Please how should I solve the problem of making microc hex file work in real hardware. Thanks.
Olakunle