There are some diffirences between a 16F877 and 12C509. First of all the 12C509 is not a flash device, but a OTP device, wich means it can only be programmed once. It's best to first develop your program on a flash device (like a 16F84) and then, when it is working port it to the '509
Secondly, I see you use RB3 on your 16F877, This is for low voltage programming, the 12C509 doesn't support this, only high voltage programming. Wich means you might need another programmer (don't know the programmer you are using)
now for the pinout:
GP0: Serial programming Data
GP1: Serial programming Clock
GP3/MCLR : ... MCLR