cblock 0x20 ; will change depending on chip
d1
d2
d3
endc
ORG 0x000
GOTO Init
ORG 0x004
GOTO Main
Init
bsf STATUS,RP0
movlw b'11111111'
movwf PORTA ; porta all input
movlw b'00000000'
movwf PORTB; portb all output
bcf STATUS, RPO
CLRF PORTB ; port b all low
goto Main
Main
btfsc PORTA,1 ;if port a,1 = high
bsf PORTB,3 ; set portb, 3
Call delay
bcf PORTB,3 ; if PORTA,1 is no longer pressed this will turn off that led
goto Main
delay1 ; half a millisecond delay
MOVLW 0x0B0
MOVWF d1
MOVLW 17h
MOVWF d2
MOVLW 0x02
MOVWF d3
delay2
DECFSZ d1,F
GOTO $+2
DECFSZ d2,F
GOTO $+2
DECFSZ d3,F
GOTO delay2
GOTO $+1
GOTO $+1
GOTO $+1
RETLW D'00' ; 499994 cycles
END