I commented out these two lines
Code:
include "pbppic14.lib"
include "16F877.bas"
and the rest of your code compiled here. Give it a try. I will look at the remainder in a bit.