Professional Documents
Culture Documents
dat"
$crystal = 8000000
$baud = 9600
$hwstack = 40
$swstack = 16
$framesize = 32
Ddrb = &B00001111
Portb = &B11111111
Dim T As Byte
Dim W As Bit
W=0
'################################################################################
##########################################
'Claveantigua = 0
'Writeeeprom Claveantigua , 0
Principal:
Goto Principal
Teclado:
Tecla = 16
A=0
If E = 0 Then Tecla = 7
If F = 0 Then Tecla = 8
If G = 0 Then Tecla = 9
If H = 0 Then Tecla = 10
A=1
B=0
If E = 0 Then Tecla = 4
If F = 0 Then Tecla = 5
If G = 0 Then Tecla = 6
If H = 0 Then Tecla = 11
B=1
C=0
If E = 0 Then Tecla = 1
If F = 0 Then Tecla = 2
If G = 0 Then Tecla = 3
If H = 0 Then Tecla = 12
C=1
D=0
If E = 0 Then Tecla = 13
If F = 0 Then Tecla = 0
If G = 0 Then Tecla = 14
If H = 0 Then Tecla = 15
D=1
Waitms 270
If Cont = 0 Then
V = Tecla
Cont = 2
Y = Tecla
Cont = 3
Z = Tecla
Cont = 0
Waitms 250
X = X * 100
Y = Y * 10
Z=Z*1
Clavenueva = V + X
Clavenueva = Clavenueva + Y
Clavenueva = Clavenueva + Z
Waitms 250
Readeeprom Claveantigua , 0
Waitms 200
For Cont = 0 To 5
Print "##################################################"
Print
"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"
Print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Next
Waitms 200
Goto Controlesdelsistema
Else
Goto Teclado
End If
End If
End If
' tecla = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Goto Teclado
'################################################################################
#########################3
Generarclave:
Readeeprom Claveantigua , 0
Waitms 150
Zzz:
Waitms 1000
Zz:
V = Waitkey() - 48
X = Waitkey() - 48
Y = Waitkey() - 48
Z = Waitkey() - 48
V = V * 1000
X = X * 100
Y = Y * 10
Z=Z*1
Claveantigua = V + X
Claveantigua = Claveantigua + Y
Claveantigua = Claveantigua + Z
Waitms 250
Writeeeprom Claveantigua , 0
Print "clave correcta"
Else
Waitms 250
Goto Zz
End If
Else
Zzzz:
Readeeprom Claveantigua , 0
V = Waitkey() - 48
X = Waitkey() - 48
Y = Waitkey() - 48
Z = Waitkey() - 48
V = V * 1000
X = X * 100
Y = Y * 10
Z=Z*1
Clavenueva = V + X
Clavenueva = Clavenueva + Y
Clavenueva = Clavenueva + Z
Waitms 250
Goto Zzz
Else
Goto Zzzz:
End If
End If
End If
Waitms 1000
Cont = 0
Goto Teclado
End If
Goto Salirdelsistema
End If
Goto Principal
'################################################################################
###########################################
Controlesdelsistema:
Tecla = 16
A=0
If E = 0 Then Tecla = 7
If F = 0 Then Tecla = 8
If G = 0 Then Tecla = 9
If H = 0 Then Tecla = 10
A=1
B=0
If E = 0 Then Tecla = 4
If F = 0 Then Tecla = 5
If G = 0 Then Tecla = 6
If H = 0 Then Tecla = 11
B=1
C=0
If E = 0 Then Tecla = 1
If F = 0 Then Tecla = 2
If G = 0 Then Tecla = 3
If H = 0 Then Tecla = 12
C=1
D=0
If E = 0 Then Tecla = 13
If F = 0 Then Tecla = 0
If G = 0 Then Tecla = 14
If H = 0 Then Tecla = 15
D=1
Waitms 200
Print " "
If W = 0 Then
Portc.tecla = 1
W=1
Else
Portc.tecla = 0
W=0
End If
End If
If Tecla = 13 Then
Goto Salirdelsistema
End If
Goto Controlesdelsistema
'################################################################################
################
Salirdelsistema:
Waitms 1000
End