See Melanie's excellent post here

http://list.picbasic.com/forum/messages/3064/3607.html?

it is for a different processor but converting to the 877a should be straight forward. Reply if you need more