DQ VAR portD.0 ' One-wire data pin c.0 worked on 45K20
tx VAR portC.3
a 12F509 has no portc or portd it has a gpio




if you look in the manual you will find
SEROUT2 is not supported on 12-bit core PIC MCUs due to RAM and stack constraints.
use debug or serout instead