Post the schematics and/or Proteus design file, I do remember making a melody alarm clock based on PIC18F2550 a few other chips, once you post the schematic/dsn file I try to port the alarm part of the code/design to 877A (provided I find it soon).
For people crapping my inbox with PM, please stop it.
If I find the project, and the thread starter posts his schematics, I will port it to 16F877A and post the results here. I strongly discourage private sharing, this is a discussion board and we are here to share with all, not specific individuals. Please understand this and stop sending me PMs.