LIST p=16F737 ;tell assembler what chip we are using
include "P16F737.inc" ;include the defaults for the chip
errorlevel -302 ; no bank warnings
; Configuration bits
; ==================
; specified here are changes to the .inc file defaults
__CONFIG _CONFIG1, _CP_OFF & _CCP2_RC1 & _DEBUG_OFF & _VBOR_2_0 & _BOREN_0 & _MCLR_On & _PWRTE_OFF & _WDT_OFF & _INTRC_IO
org 0x0000 ;org sets the origin,
Start goto Main ;this is where the program starts running
Main
bsf STATUS, RP0 ;select bank 1
movlw b'01100010' ; set internal osc to 4 mhz
movwf OSCCON
movlw 0x07
movwf CMCON ;turn comparators off
movlw b'00000000' ;set PortB all outputs
movwf TRISB
movwf TRISA ;set PortA all outputs
bcf STATUS, RP0 ;select bank 0
Loop
movlw 0xff
movwf PORTA ;set all bits on
movwf PORTB
nop ;the nop's make up the time taken by the goto
nop ;giving a square wave output
movlw 0x00
movwf PORTA
movwf PORTB ;set all bits off
goto Loop ;go back and do it again
end