list p=16f628A ; list directive to define processor
#include <p16F628A.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file
__CONFIG _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _INTOSC_OSC_NOCLKOUT
cblock 0x20
d1
endc
org 0x0000 ;org sets the origin, 0x0000 for the 16F628,
;this is where the program starts running
main:
movlw 0x07
movwf CMCON ;turn comparators off (make it like a 16F84)
bsf STATUS, RP0 ;select bank 1
movlw b'00000000' ;set PortB all outputs
movwf TRISB
movlw b'00000001'
movwf TRISA ;set PortA all outputs
bcf STATUS, RP0 ;select bank 0