list P=16F84
include P16F84.INC
; Define the direction bit types
f equ 1
w equ 0
; Define the data storage locations
org 0x20
counter res 1
counter_2 res 1
entered_pass_code res 1
num_pass_codes res 1
something_clever res 1
org 0x30
passcodes res 8 ;location of the program
; start defining the program
; no interrupts, so start at 0x0
org 0x00
compare_to_list
call indirect
incf counter_2,f
incf counter,w
subwf num_pass_codes,f
btfss STATUS,Z
goto no_match
goto compare_to_list
indirect
movlw passcodes
addwf counter_2,w
movwf FSR
movf INDF,w
movwf something_clever
movf entered_pass_code,w
subwf something_clever,f
btfss STATUS,Z
goto match_found
return
match_found
nop
no_match
nop
end