Add these to you code:
DEFINE OSC 4 ' Tells your PIC how fast it is running
ADCON0 = 0 ' Disable A/D
CCP1CON = 0 "Disable Comparators

Power on.MCLR,BOD, . . . reset . . . Defaults to TRISD = %11111111
TrisE = %00001111 FYI check Datasheet 3.5 RE: MSP if TrisE.4 is set, As a beginner, if I were you, I would park that HP Chevelle in the garage and practice in the Toyota. A 16F628A, 16F648A, or !6f690 with PICKIT2 and Demo board, Get your feet wet with those, then go back to the 877. Just my opinion.