Hi Pasan, please see the site below and some of the comments are extracted from there and pasted here. perhaps you have to use winpic or winpic800 for programming f877 where as f877A is programmable by ic-prog.
**broken link removed**
PIC16F870(8),PIC16F871(8),PIC16F872,PIC16F873,PIC16F874(4),PIC16F876(5),PIC16F877(5)
PIC16F873A(5),PIC16F874A(5),PIC16F876A,PIC16F877A
(5) IC-Prog cannot program/verify/erase these devices with Multi PIC Programmer 5V2. Please use WinPic.