Hi everyone!

I can read and write now using the pic16f84a but I can't do that using pic16f877a.
Is there any lines I have to add inorder to allow reading and writing the eeprom?
I've read the 16f877a datasheet. It is stated there that I have to disable all interrupts before writing. I've tried that but still won't work.

A working simple code for reading and writing the internal eeprom of pic16f877a is all I need.

Please help me...
Thank you in advance.