LIST p=16F877
include "P16F877.inc"
__config 0x393A
org 0x0000 ;org sets the origin, 0x0000 for the 16F628,
;this is where the program starts running
BANKSEL ADCON1
movlw 0x06
movwf ADCON1
BANKSEL PORTA
bsf STATUS, RP0 ;select bank 1
movlw b'00000000' ;set PortB all outputs
movwf TRISB
movwf TRISA
movwf TRISC ;set PortA all outputs
bcf STATUS, RP0 ;select bank 0
Loop
movlw 0xff
movwf PORTA ;set all bits on
movwf PORTB
movwf PORTC
nop ;the nop's make up the time taken by the goto
nop ;giving a square wave output
movlw 0x00
movwf PORTA ;set all bits on
movwf PORTB
movwf PORTC
goto Loop ;go back and do it again
end