ORG 0x00
GOTO MAINLOOP
ORG 0x04
BSF PORTC,0
MOVFW PORTB
BCF INTCON, RBIF
RETFIE
CONFIG BSF STATUS, 5 ;cambio al banco 1
BSF INTCON, RBIE
BSF INTCON, GIE
MOVLW B'11110000'
MOVWF TRISB ;RB4 - RB7 son entradas
CLRF TRISC ;RC0 - RC7 como salidas
BCF STATUS, 5 ;retorno al banco cero
MAINLOOP
BSF PORTC,1 ;set all bits on
nop ;the nop's make up the time taken by the goto
nop ;giving a square wave output
call Delay ;this waits for a while!
BCF PORTC,1
call Delay
BCF PORTC,0
goto MAINLOOP ;go back and do it again
Delay movlw d'250' ;delay 250 ms (4 MHz clock)
movwf count1
d1 movlw 0xC7
movwf counta
movlw 0x01
movwf countb
Delay_0
decfsz counta, f
goto $+2
decfsz countb, f
goto Delay_0
decfsz count1 ,f
goto d1
retlw 0x00