-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathretardo_loops.asm
More file actions
114 lines (86 loc) · 1.43 KB
/
retardo_loops.asm
File metadata and controls
114 lines (86 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
__config 0x3F30
STATUS equ 0x03
PORTA equ 0x05
PORTB equ 0x06
TRISA equ 0x85
TRISB equ 0x86
CMCON equ 0x1F
contador equ 0x20
contador2 equ 0x21
org 0x00; inicio del proyecto
movlw 0x07
movwf CMCON
bsf STATUS,5; banco 1
clrf TRISB; Todo el puerto B como salida
bsf TRISA,1; RA1 como entrada
bcf STATUS,5; banco 0
movlw 0xFF
movwf PORTB
ini: call retardo
call retardo
call retardo
clrf PORTB
bucleA: bsf PORTB,0
call retardo
bcf PORTB,0
bsf PORTB,1
call retardo
bcf PORTB,1
bsf PORTB,2
call retardo
bcf PORTB,2
bsf PORTB,3
call retardo
bcf PORTB,3
bsf PORTB,4
call retardo
bcf PORTB,4
bsf PORTB,5
call retardo
bcf PORTB,5
bsf PORTB,6
call retardo
bcf PORTB,6
bsf PORTB,7
call retardo
bcf PORTB,7
bsf PORTB,6
call retardo
bcf PORTB,6
bsf PORTB,5
call retardo
bcf PORTB,5
bsf PORTB,4
call retardo
bcf PORTB,4
bsf PORTB,3
call retardo
bcf PORTB,3
bsf PORTB,2
call retardo
bcf PORTB,2
bsf PORTB,1
call retardo
bcf PORTB,1
goto bucleA
retardo: call retardoB
call retardoB
call retardoB
call retardoB
call retardoB
call retardoB
return
retardoB: movlw 0xFF
retAnidado: movwf contador2
bucle2: decfsz contador2,1
goto retardar
goto salir
retardar: call retardoBucle
goto bucle2
salir: return
retardoBucle: movlw d'200'
movwf contador
bucle: decfsz contador,1
goto bucle
return
end