Documentos de Académico
Documentos de Profesional
Documentos de Cultura
inc>
__CONFIG _FOSC_XT & _WDTE_OFF & _PWRTE_ON & _BOREN_ON & _LVP_OFF & _CPD_OFF &
_WRT_OFF & _CP_OFF
;Declaraci�n de VARIABLES
CONV_TECLA
addwf PCL,1
nop ;Linea 0 (no se utiliza)
goto UNO
goto DOS
goto TRES
goto AA
goto CUATRO
goto CINCO
goto SEIS
goto BB
goto SIETE
goto OCHO
goto NUEVE
goto CC
goto FF
goto CERO
goto EE
goto DD
INICIO
clrf PORTB ; Limpia PORTB
clrf PORTC ; Limpia PORTC
clrf PORTD ; Limpia PORTD
bsf STATUS,RP0 ; Selecciona banco 1
movlw 0x06
movwf ADCON1
clrf PORTA
movlw 0xF0 ; PortB0-3 Salidas
movwf TRISB ; PortB4-7 Entradas
clrf TRISC ; PortC0-1 Salidas
clrf TRISD ; PortD0-7 Salidas
bcf OPTION_REG,7 ; Habilita Resistencias de
; polarizaci�n en entradas
bcf STATUS,RP0 ; Selecciona banco 0
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
bsf BANDERA_MENU1
bcf BANDERA_MENU2
bcf BANDERA_TECLEA_1
bcf BANDERA_TECLEA_2
BCF BANDERA_CAMBIO_1
BCF BANDERA_CAMBIO_2
movlw .1
movwf VAR1
movlw .7
movwf VAR2
movlw .8
movwf VAR3
movlw .9
movwf VAR4
clrf CONT_BLOQUEA_USER1
clrf CONT_BLOQUEA_USER2
;Inicio
START
clrf caracter
call INICIA_LCD ;Configura el LCD
goto ADMIN
REGRESA_MENU
goto NEW_SCAN ;Comienza el SCAN del TECLADO
ADMIN
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
bcf BANDERA_MENU2
bcf BANDERA_MENU1
bcf BANDERA_USER_1
bcf BANDERA_USER_2
bcf BANDERA_TECLEA_1
bcf BANDERA_TECLEA_2
BCF BANDERA_CAMBIO_1
BCF BANDERA_CAMBIO_2
BSF BANDERA_ADMIN
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
movlw b'01000001' ;A
movwf PORTD
call ENVIAMENU
movlw b'01000100' ;D
movwf PORTD
call ENVIAMENU
movlw b'01001101' ;M
movwf PORTD
call ENVIAMENU
movlw b'01001001' ;I
movwf PORTD
call ENVIAMENU
movlw b'01001110' ;N
movwf PORTD
call ENVIAMENU
movlw b'00111010' ;:
movwf PORTD
call ENVIAMENU
call ASIGNA_VALORES_ADMIN
goto REGRESA_MENU
;**************************************************************************
MENU
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
;clrf numTecla
bsf BANDERA_MENU2
bcf BANDERA_MENU1
bcf BANDERA_USER_1
bcf BANDERA_USER_2
bcf BANDERA_TECLEA_1
bcf BANDERA_TECLEA_2
BCF BANDERA_CAMBIO_1
BCF BANDERA_CAMBIO_2
movlw 'A' ;A
movwf PORTD
call ENVIAMENU
movlw 'D' ;D
movwf PORTD
call ENVIAMENU
movlw 'M' ;M
movwf PORTD
call ENVIAMENU
movlw 'I' ;I
movwf PORTD
call ENVIAMENU
movlw 'N' ;N
movwf PORTD
call ENVIAMENU
movlw ':' ;
movwf PORTD
call ENVIAMENU
movlw '0' ;
movwf PORTD
call ENVIAMENU
movlw 'U' ;S
movwf PORTD
call ENVIAMENU
movlw 'S' ;U
movwf PORTD
call ENVIAMENU
movlw 'E' ;U
movwf PORTD
call ENVIAMENU
movlw 'R' ;U
movwf PORTD
call ENVIAMENU
movlw ':' ;U
movwf PORTD
call ENVIAMENU
movlw '1' ;U
movwf PORTD
call ENVIAMENU
movlw '-' ;U
movwf PORTD
call ENVIAMENU
movlw '2' ;U
movwf PORTD
call ENVIAMENU
;******************CAMBIO DE LINEA
bcf PORTC,RC0
movlw b'11000000'
movwf PORTD
call ENVIABRINCO
movlw 'S' ;S
movwf PORTD
call ENVIAMENU
movlw 'E' ;E
movwf PORTD
call ENVIAMENU
movlw 'L' ;L
movwf PORTD
call ENVIAMENU
movlw ':'
movwf PORTD
call ENVIAMENU
goto NEW_SCAN
;*******************************************************************************
ENVIABRINCO
bcf PORTC,0
call COMANDOMENUBRINCO
return
COMANDOMENUBRINCO
bsf PORTC,1
call DELAYMENU
bcf PORTC,1
return
ENVIAMENU
bsf PORTC, 0 ; RS=1 MODO DATO
call COMANDOMENU ; Se da de alta el comando
return
COMANDOMENU
bsf PORTC, 1 ; Pone la se�al ENABLE en 1
call DELAYMENU ; Espera estabilizar la se�al ; Espera estabilizar
la se�al
bcf PORTC, 1 ; ENABLE=0 ; Espera estabilizar la se�al
return
DELAYMENU
movlw .20
movwf cont2M
loop1MENU
movlw .20
movwf cont1M
loop2MENU
decfsz cont1M,1
goto loop2MENU
decfsz cont2M,1
goto loop1MENU
return
; Rutina de retardo
; Para estabilizar la se�al de ENABLE
DELAY
movlw 0xFF
movwf cont2
loop1
movlw 0xFF
movwf cont1
loop2
decfsz cont1,1
goto loop2
decfsz cont2,1
goto loop1
return
REGRESO_ASIGNACION
movf numTecla,w ; Pone en W el valor de numTecla
goto CONV_TECLA ; Llama a la rutina de conversi�n
REGRESO_CONV_TECLA
btfsc BANDERA_CONTRA
goto CONTRASE�A_CORRECTA
movf 0X22,W
movwf VAR3_1
movf 0X23,W
movwf VAR4_1
goto REGRESO_ASIGNACION
ASIGNA_VALORES_2
movf 0X20,W ;PRIMER DIGITO DE LA CLAVE
movwf VAR1_2
movf 0X23,W
movwf VAR4_2
goto REGRESO_ASIGNACION
ASIGNA_VALORES_ADMIN
movlw .1
movwf VAR1
movlw .7
movwf VAR2
movlw .8
movwf VAR3
movlw .9
movwf VAR4
return
;**********************************************************************************
OPCION_USER_1
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
clrf numTecla
bcf BANDERA_MENU2
bcf BANDERA_MENU1
bsf BANDERA_USER_1
bcf BANDERA_USER_2
bcf BANDERA_TECLEA_1
bcf BANDERA_TECLEA_2
BCF BANDERA_CAMBIO_1
BCF BANDERA_CAMBIO_2
bcf BANDERA_ADMIN
movlw 'U' ;A
movwf PORTD
call ENVIAMENU
movlw 'S' ;D
movwf PORTD
call ENVIAMENU
movlw 'E' ;M
movwf PORTD
call ENVIAMENU
movlw 'R' ;I
movwf PORTD
call ENVIAMENU
movlw '1' ;N
movwf PORTD
call ENVIAMENU
movlw 'O' ;
movwf PORTD
call ENVIAMENU
movlw 'P' ;U
movwf PORTD
call ENVIAMENU
movlw '(' ;S
movwf PORTD
call ENVIAMENU
movlw '1' ;U
movwf PORTD
call ENVIAMENU
movlw '-' ;U
movwf PORTD
call ENVIAMENU
movlw '2' ;U
movwf PORTD
call ENVIAMENU
movlw ')' ;U
movwf PORTD
call ENVIAMENU
;******************CAMBIO DE LINEA
bcf PORTC,RC0
movlw b'11000000'
movwf PORTD
call ENVIABRINCO
movlw 'S' ;S
movwf PORTD
call ENVIAMENU
movlw 'E' ;E
movwf PORTD
call ENVIAMENU
movlw 'L' ;L
movwf PORTD
call ENVIAMENU
movlw ':'
movwf PORTD
call ENVIAMENU
goto REGRESA_MENU
;*******************************************************************************
OPCION_USER_2
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
clrf numTecla
bcf BANDERA_MENU2
bcf BANDERA_MENU1
bcf BANDERA_USER_1
bsf BANDERA_USER_2
bcf BANDERA_TECLEA_1
bcf BANDERA_TECLEA_2
BCF BANDERA_CAMBIO_1
BCF BANDERA_CAMBIO_2
bcf BANDERA_ADMIN
movlw 'U' ;A
movwf PORTD
call ENVIAMENU
movlw 'S' ;D
movwf PORTD
call ENVIAMENU
movlw 'E' ;M
movwf PORTD
call ENVIAMENU
movlw 'R' ;I
movwf PORTD
call ENVIAMENU
movlw '2' ;N
movwf PORTD
call ENVIAMENU
movlw 'O' ;
movwf PORTD
call ENVIAMENU
movlw 'P' ;U
movwf PORTD
call ENVIAMENU
movlw '(' ;S
movwf PORTD
call ENVIAMENU
movlw '1' ;U
movwf PORTD
call ENVIAMENU
movlw '-' ;U
movwf PORTD
call ENVIAMENU
movlw '2' ;U
movwf PORTD
call ENVIAMENU
movlw ')' ;U
movwf PORTD
call ENVIAMENU
;******************CAMBIO DE LINEA
bcf PORTC,RC0
movlw b'11000000'
movwf PORTD
call ENVIABRINCO
movlw 'S' ;S
movwf PORTD
call ENVIAMENU
movlw 'E' ;E
movwf PORTD
call ENVIAMENU
movlw 'L' ;L
movwf PORTD
call ENVIAMENU
movlw ':'
movwf PORTD
call ENVIAMENU
goto REGRESA_MENU
;*********************************************************************
OPCION_USER1_CAMBIO
bsf BANDERA_OPCION_USER1_CAMBIO
btfsc BANDERA_OPCION_USER1_CAMBIO
goto ADMIN
OPCION_USER1_CAMBIO2
bcf BANDERA_OPCION_USER1_CAMBIO
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
clrf numTecla
bcf BANDERA_MENU2
bcf BANDERA_MENU1
bcf BANDERA_USER_1
bcf BANDERA_USER_2
bcf BANDERA_TECLEA_1
bcf BANDERA_TECLEA_2
BSF BANDERA_CAMBIO_1
BCF BANDERA_CAMBIO_2
bcf BANDERA_ADMIN
movlw 'N' ;A
movwf PORTD
call ENVIAMENU
movlw 'U' ;D
movwf PORTD
call ENVIAMENU
movlw 'E' ;M
movwf PORTD
call ENVIAMENU
movlw 'V' ;I
movwf PORTD
call ENVIAMENU
movlw 'A' ;N
movwf PORTD
call ENVIAMENU
movlw ':' ;
movwf PORTD
call ENVIAMENU
goto REGRESA_MENU
;******************************************************************************
OPCION_USER2_CAMBIO
bsf BANDERA_OPCION_USER2_CAMBIO
btfsc BANDERA_OPCION_USER2_CAMBIO
goto ADMIN
OPCION_USER2_CAMBIO2
bcf BANDERA_OPCION_USER2_CAMBIO
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
clrf numTecla
bcf BANDERA_MENU2
bcf BANDERA_MENU1
bcf BANDERA_USER_1
bcf BANDERA_USER_2
bcf BANDERA_TECLEA_1
bcf BANDERA_TECLEA_2
BCF BANDERA_CAMBIO_1
BSF BANDERA_CAMBIO_2
bcf BANDERA_ADMIN
movlw 'N' ;A
movwf PORTD
call ENVIAMENU
movlw 'U' ;D
movwf PORTD
call ENVIAMENU
movlw 'E' ;M
movwf PORTD
call ENVIAMENU
movlw 'V' ;I
movwf PORTD
call ENVIAMENU
movlw 'A' ;N
movwf PORTD
call ENVIAMENU
movlw ':' ;
movwf PORTD
call ENVIAMENU
goto REGRESA_MENU
;**************************************************************************
OPCION_USER1_TECLEA
bcf STATUS,Z
movlw .3
subwf CONT_BLOQUEA_USER1,W
btfsc STATUS,Z
goto BLOQUEAR
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
clrf numTecla
bcf BANDERA_MENU2
bcf BANDERA_MENU1
bcf BANDERA_USER_1
bcf BANDERA_USER_2
bsf BANDERA_TECLEA_1
bcf BANDERA_TECLEA_2
BcF BANDERA_CAMBIO_1
BCF BANDERA_CAMBIO_2
bcf BANDERA_ADMIN
movlw 'T' ;A
movwf PORTD
call ENVIAMENU
movlw 'E' ;D
movwf PORTD
call ENVIAMENU
movlw 'C' ;M
movwf PORTD
call ENVIAMENU
movlw 'L' ;I
movwf PORTD
call ENVIAMENU
movlw 'E' ;N
movwf PORTD
call ENVIAMENU
movlw 'A' ;
movwf PORTD
call ENVIAMENU
movlw ':' ;
movwf PORTD
call ENVIAMENU
goto REGRESA_MENU
;******************************************************************************
OPCION_USER2_TECLEA
bcf STATUS,Z
movlw .3
subwf CONT_BLOQUEA_USER2,W
btfsc STATUS,Z
goto BLOQUEAR
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
clrf TEMP
movlw 0x20
movwf FSR
bcf BANDERA_CONTRA
clrf numTecla
bcf BANDERA_MENU2
bcf BANDERA_MENU1
bcf BANDERA_USER_1
bcf BANDERA_USER_2
bcf BANDERA_TECLEA_1
bsf BANDERA_TECLEA_2
BcF BANDERA_CAMBIO_1
BCF BANDERA_CAMBIO_2
bcf BANDERA_ADMIN
movlw 'T' ;A
movwf PORTD
call ENVIAMENU
movlw 'E' ;D
movwf PORTD
call ENVIAMENU
movlw 'C' ;M
movwf PORTD
call ENVIAMENU
movlw 'L' ;I
movwf PORTD
call ENVIAMENU
movlw 'E' ;N
movwf PORTD
call ENVIAMENU
movlw 'A' ;
movwf PORTD
call ENVIAMENU
movlw ':' ;
movwf PORTD
call ENVIAMENU
goto REGRESA_MENU
;***************************************************************************
CONTRASE�A_INCORRECTA
movlw 'i'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DELAY
bcf BANDERA_MENU2
bsf BANDERA_MENU1
btfsc BANDERA_CAMBIO_1
goto OPCION_USER_1
btfsc BANDERA_CAMBIO_2
goto OPCION_USER_2
call INCORRECTA
goto ADMIN
CONTRASE�A_CORRECTA
movlw 'C'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DELAY
bsf BANDERA_MENU2
bcf BANDERA_MENU1
call ADELANTE
btfsc BANDERA_OPCION_USER1_CAMBIO
goto OPCION_USER1_CAMBIO2
btfsc BANDERA_OPCION_USER2_CAMBIO
goto OPCION_USER2_CAMBIO2
goto MENU
;*******************************************************************************
ADELANTE
; btfsc BANDERA_CAMBIO_1
; return
;
; btfsc BANDERA_CAMBIO_2
; return
btfsc BANDERA_OPCION_USER1_CAMBIO
return
btfsc BANDERA_OPCION_USER2_CAMBIO
return
btfsc BANDERA_CAMBIO_1
return
btfsc BANDERA_CAMBIO_2
return
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
movlw 'A' ;A
movwf PORTD
call ENVIAMENU
movlw 'D' ;D
movwf PORTD
call ENVIAMENU
movlw 'E' ;M
movwf PORTD
call ENVIAMENU
movlw 'L' ;I
movwf PORTD
call ENVIAMENU
movlw 'A' ;N
movwf PORTD
call ENVIAMENU
movlw 'N' ;
movwf PORTD
call ENVIAMENU
movlw 'T' ;M
movwf PORTD
call ENVIAMENU
movlw 'E' ;M
movwf PORTD
call ENVIAMENU
movlw '!' ;M
movwf PORTD
call ENVIAMENU
bsf PORTC,2
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
bcf PORTC,2
return
;*******************************************************************************
INCORRECTA
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
movlw 'I' ;A
movwf PORTD
call ENVIAMENU
movlw 'N' ;D
movwf PORTD
call ENVIAMENU
movlw 'C' ;M
movwf PORTD
call ENVIAMENU
movlw 'O' ;I
movwf PORTD
call ENVIAMENU
movlw 'R' ;N
movwf PORTD
call ENVIAMENU
movlw 'R' ;
movwf PORTD
call ENVIAMENU
movlw 'E' ;M
movwf PORTD
call ENVIAMENU
movlw 'C' ;I
movwf PORTD
call ENVIAMENU
movlw 'T' ;N
movwf PORTD
call ENVIAMENU
movlw 'A' ;
movwf PORTD
call ENVIAMENU
movlw '!' ;M
movwf PORTD
call ENVIAMENU
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
btfsc BANDERA_TECLEA_1
incf CONT_BLOQUEA_USER1,F
btfsc BANDERA_TECLEA_2
incf CONT_BLOQUEA_USER2,F
btfsc BANDERA_TECLEA_1
goto OPCION_USER1_TECLEA
btfsc BANDERA_TECLEA_2
goto OPCION_USER2_TECLEA
btfsc BANDERA_ADMIN
goto ADMIN
goto MENU
;*******************************************************************************
BLOQUEAR
clrf CONT_BLOQUEA_USER1
clrf CONT_BLOQUEA_USER2
bcf PORTC,0
movlw b'00000001'
movwf PORTD
bsf PORTC,1
NOP
bcf PORTC,1
call DELAY
movlw 'B' ;A
movwf PORTD
call ENVIAMENU
movlw 'L' ;D
movwf PORTD
call ENVIAMENU
movlw 'O' ;M
movwf PORTD
call ENVIAMENU
movlw 'Q' ;I
movwf PORTD
call ENVIAMENU
movlw 'U' ;N
movwf PORTD
call ENVIAMENU
movlw 'E' ;
movwf PORTD
call ENVIAMENU
movlw 'A' ;
movwf PORTD
call ENVIAMENU
movlw 'D' ;
movwf PORTD
call ENVIAMENU
movlw 'O' ;
movwf PORTD
call ENVIAMENU
movlw '!' ;
movwf PORTD
call ENVIAMENU
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
;HASTA AQUI TRES SEGUNDOS
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
;HASTA AQUI SEIS SEGUNDOS
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
call DELAY
;HASTA AQUI 10 SEGUNDOS
goto MENU
;*******************************************************************************
;contrase�a 0 1 2 3
COMPARA_CONTRASE�A
btfsc BANDERA_ADMIN
goto COMPARA_ADMIN
btfsc BANDERA_TECLEA_1
goto COMPARA_USER_1
btfsc BANDERA_TECLEA_2
goto COMPARA_USER_2
btfsc BANDERA_ADMIN
call ASIGNA_VALORES_ADMIN
btfsc BANDERA_CAMBIO_1
goto CAMBIO_VALORES_1
btfsc BANDERA_CAMBIO_2
goto CAMBIO_VALORES_2
COMPARA_ADMIN
bcf STATUS,Z
movf VAR1,W
subwf 0X20,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR2,W
subwf 0x21,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR3,W
subwf 0X22,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR4,W
subwf 0X23,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
goto TERMINO_COMPARA
COMPARA_USER_1
bcf STATUS,Z
movf VAR1_1,W
subwf 0X20,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR2_1,W
subwf 0x21,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR3_1,W
subwf 0X22,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR4_1,W
subwf 0X23,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
goto TERMINO_COMPARA
COMPARA_USER_2
bcf STATUS,Z
movf VAR1_2,W
subwf 0X20,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR2_2,W
subwf 0x21,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR3_2,W
subwf 0X22,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
bcf STATUS,Z
movf VAR4_2,W
subwf 0X23,W
btfss STATUS,Z
goto CONTRASE�A_INCORRECTA
TERMINO_COMPARA
;btfsc BANDERA_CAMBIO_1
; call CAMBIO_VALORES_1
; btfsc BANDERA_CAMBIO_2
; call CAMBIO_VALORES_2
TERMINO_ASIGNA
bsf BANDERA_CONTRA
return
CAMBIO_VALORES_ADMIN
movf 0x20,W
movwf VAR1
movf 0x21,W
movwf VAR2
movf 0x22,W
movwf VAR3
movf 0x23,W
movwf VAR4
; bcf BANDERA_MENU2
; bsf BANDERA_MENU1
; bcf BANDERA_USER_1
; bcf BANDERA_USER_2
; bcf BANDERA_TECLEA_1
; bcf BANDERA_TECLEA_2
; BcF BANDERA_CAMBIO_1
; BCF BANDERA_CAMBIO_2
; bcf BANDERA_ADMIN
return
CAMBIO_VALORES_1
movf 0x20,W
movwf VAR1_1
movf 0x21,W
movwf VAR2_1
movf 0x22,W
movwf VAR3_1
movf 0x23,W
movwf VAR4_1
; bcf BANDERA_MENU2
; bsf BANDERA_MENU1
; bcf BANDERA_USER_1
; bcf BANDERA_USER_2
; bcf BANDERA_TECLEA_1
; bcf BANDERA_TECLEA_2
; BcF BANDERA_CAMBIO_1
; BCF BANDERA_CAMBIO_2
; bcf BANDERA_ADMIN
;
goto TERMINO_ASIGNA
CAMBIO_VALORES_2
movf 0x20,W
movwf VAR1_2
movf 0x21,W
movwf VAR2_2
movf 0x22,W
movwf VAR3_2
movf 0x23,W
movwf VAR4_2
; bCf BANDERA_MENU2
; bSf BANDERA_MENU1
; bcf BANDERA_USER_1
; bcf BANDERA_USER_2
; bcf BANDERA_TECLEA_1
; bcf BANDERA_TECLEA_2
; BcF BANDERA_CAMBIO_1
; BCF BANDERA_CAMBIO_2
; bcf BANDERA_ADMIN
goto TERMINO_ASIGNA
DIRECCIONAMIENTO_0
movlw .0
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_1
movlw .1
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_2
movlw .2
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_3
movlw .3
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_4
movlw .4
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_5
movlw .5
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_6
movlw .6
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_7
movlw .7
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_8
movlw .8
movwf INDF
incf FSR,F
return
DIRECCIONAMIENTO_9
movlw .9
movwf INDF
incf FSR,F
return
CERO
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
btfsc BANDERA_MENU2
goto INICIO
call DIRECCIONAMIENTO_0
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
UNO
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
btfsc BANDERA_MENU2
goto OPCION_USER_1
btfsc BANDERA_USER_1
goto OPCION_USER1_TECLEA
btfsc BANDERA_USER_2
goto OPCION_USER2_TECLEA
call DIRECCIONAMIENTO_1
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
DOS
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
btfsc BANDERA_MENU2
goto OPCION_USER_2
btfsc BANDERA_USER_1
goto OPCION_USER1_CAMBIO
btfsc BANDERA_USER_2
goto OPCION_USER2_CAMBIO
call DIRECCIONAMIENTO_2
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
TRES
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DIRECCIONAMIENTO_3
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
CUATRO
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DIRECCIONAMIENTO_4
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
CINCO
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DIRECCIONAMIENTO_5
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
SEIS
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DIRECCIONAMIENTO_6
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
SIETE
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DIRECCIONAMIENTO_7
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
OCHO
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DIRECCIONAMIENTO_8
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
NUEVE
movlw '*'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
call DIRECCIONAMIENTO_9
bcf STATUS,Z
incf TEMP,F
movlw .7
subwf TEMP,W
btfsc STATUS,Z
call COMPARA_CONTRASE�A
goto REGRESO_CONV_TECLA
AA
movlw .10
movwf PORTA
movlw 'A'
movwf PORTD ; Manda la conversi�n al puerto D
call ENVIA ; Manda Datos al LCD
return
BB
movlw .11
movwf PORTA
movlw 'B'
CC
movlw .12
movwf PORTA
movlw 'C'
DD
movlw .13
movwf PORTA
movlw 'D'
EE
movlw .14
movwf PORTA
movlw 'E'
FF
movlw .15
movwf PORTA
movlw 'F'
end