Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
MPASM 02.80 Released            OVLAD.ASM   7-12-2002  20:18:51         PAGE  1
2
 
3
 
4
LOC  OBJECT CODE     LINE SOURCE TEXT
5
  VALUE
6
 
7
                      00001 #include 16C84.INC
8
                      00001 ;
9
                      00002 ; Definice registru a zakladnich maker pro 16C84
10
                      00003 ;
11
                      00004                 processor       16f84
12
                      00005                 radix   D
13
                      00006 
14
0000                  00007 __16C84__:      ; Priznak modulu 16C84
15
                      00008 
16
                      00009 ; Definice registru
17
                      00010 
18
  00000000            00011 IND0            equ     00H     ; 0&1 Pristup na neprimou adresu
19
  00000001            00012 TMR0            equ     01H     ; 0   Real Time clock counter
20
  00000002            00013 PCL             equ     02H     ; 0&1 Spodni cast PC
21
  00000003            00014 STATUS          equ     03H     ; 0&1 Stavove bity
22
  00000000            00015 _CARRY                          equ     0
23
  00000001            00016 _DC                             equ     1
24
  00000002            00017 _ZERO                           equ     2
25
  00000003            00018 _PD                             equ     3
26
  00000004            00019 _TO                             equ     4
27
  00000005            00020 _RP0                            equ     5
28
  00000006            00021 _RP1                            equ     6
29
  00000007            00022 _IRP                            equ     7
30
  00000004            00023 FSR             equ     04H     ; 0&1 Ukazatel pro neprime adresovani
31
  00000005            00024 PORTA           equ     05H     ; 0&1 Data a rizeni portu A
32
  00000006            00025 PORTB           equ     06H     ; 0&1 Data a rizeni portu B
33
  00000008            00026 EEDATA_0        equ     08H     ; 0   Data EEPROM
34
  00000008            00027 EECON1_1        equ     08H     ;   1 Rizeni EEPROM
35
  00000000            00028 _EERD                           equ     0
36
  00000001            00029 _EEWR                           equ     1
37
  00000002            00030 _EEWREN                         equ     2
38
  00000003            00031 _EEWRERR                        equ     3
39
  00000004            00032 _EEIF                           equ     4
40
  00000009            00033 EEADR_0         equ     09H     ; 0   Adresa EEPROM
41
  00000009            00034 EECON2_1        equ     09H     ;   1 Aktivacni pseudoregistr
42
  0000000A            00035 PCLATH          equ     0AH     ; 0&1 Horni cast PC pro move
43
  0000000B            00036 INTCON          equ     0BH     ; 0&1 Rizeni preruseni
44
  00000000            00037 _RBIF                           equ     0       ;
45
  00000001            00038 _INTF                           equ     1
46
  00000002            00039 _T0IF                           equ     2
47
  00000003            00040 _RBIE                           equ     3
48
  00000004            00041 _INTE                           equ     4
49
  00000005            00042 _T0IE                           equ     5
50
  00000006            00043 _EEIE                           equ     6
51
  00000007            00044 _GIE                            equ     7
52
                      00045 
53
                      00046 page0   macro
54
                      00047         bcf     STATUS,_RP0
55
                      00048         endm
56
                      00049 
57
                      00050 page1   macro
58
                      00051         bsf     STATUS,_RP0
59
                      00052         endm
60
MPASM 02.80 Released            OVLAD.ASM   7-12-2002  20:18:51         PAGE  2
61
 
62
 
63
LOC  OBJECT CODE     LINE SOURCE TEXT
64
  VALUE
65
 
66
                      00053 ;
67
                      00054 ; Sada maker pro porovnani a skoky
68
                      00055 ;
69
                      00056 
70
                      00057 ;--- Compare ---
71
                      00058 CMP     macro   ZNAK, PROCEDURA         ; if W=ZNAK then goto PROCEDURA
72
                      00059         xorlw   ZNAK                    ; if W#ZNAK then zachovej W a neskakej
73
                      00060         btfsc   STATUS,_ZERO
74
                      00061         goto    PROCEDURA
75
                      00062         xorlw   ZNAK
76
                      00063         endm
77
                      00064 
78
                      00065 ;--- Skip if Carry ---
79
                      00066 SC      macro
80
                      00067         btfss   STATUS,_CARRY
81
                      00068         endm
82
                      00069 
83
                      00070 ;--- Skip if not Carry ---
84
                      00071 SNC     macro
85
                      00072         btfsc   STATUS,_CARRY
86
                      00073         endm
87
                      00074 
88
                      00075 ;--- Skip if Zero ---
89
                      00076 SZ      macro
90
                      00077         btfss   STATUS,_ZERO
91
                      00078         endm
92
                      00079 
93
                      00080 ;--- Skip if not Zero ---
94
                      00081 SNZ     macro
95
                      00082         btfsc   STATUS,_ZERO
96
                      00083         endm
97
                      00084 
98
                      00085 ;--- Skip if Borrow ( Negative ) --- ( po odecitani )
99
                      00086 SB      macro
100
                      00087         btsfsc  STATUS,_CARRY
101
                      00088         endm
102
                      00089 SN      macro
103
                      00090         btfsc   STATUS,_CARRY
104
                      00091         endm
105
                      00092 
106
                      00093 ;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
107
                      00094 SNB     macro
108
                      00095         btfss   STATUS,_CARRY
109
                      00096         endm
110
                      00097 SP      macro
111
                      00098         btfss   STATUS,_CARRY
112
                      00099         endm
113
                      00100 
114
                      00101         cblock  0CH             ; Prvni volny registr
115
                      00102         endc
116
                      00002 
117
0000                  00003         org     0
118
                      00004 
119
MPASM 02.80 Released            OVLAD.ASM   7-12-2002  20:18:51         PAGE  3
120
 
121
 
122
LOC  OBJECT CODE     LINE SOURCE TEXT
123
  VALUE
124
 
125
0000   281A           00005         goto    Start
126
                      00006         ;--------------------
127
0004                  00007         org     4
128
                      00008         ;--------------------
129
0004   281A           00009         goto    Start
130
                      00010 
131
                      00011 #include Delay.asm
132
                      00001 ;--- Macro na spozdeni 1ms az 255ms ---
133
                      00002 Delay   macro   _ms
134
                      00003         movlw   _ms
135
                      00004         movwf   xxx
136
                      00005         call    Delay1ms        
137
                      00006         endm
138
                      00007 
139
                      00008 ;--- Spozdeni v nasobcich 1.002ms ----
140
0005                  00009 Jednou:
141
0005   0000           00010         nop
142
0006                  00011 Delay1ms:
143
0006   3063           00012         movlw   99              ; 1 ms
144
0007   008C           00013         movwf   yyy             ; goto 2 takty decfsz 1 kdyz 1 jinak 2
145
0008   200C           00014         call    us10
146
                      00015 
147
0009   0B8D           00016         decfsz  xxx, f
148
000A   2805           00017         goto    Jednou
149
                      00018 ;---------------------------------
150
000B   0008           00019         return                  ;2us
151
                      00020 
152
                      00021 ;--- Spozdeni v nasobcich 10us ----
153
000C                  00022 us10:                   ; Prodleva (yyy * 10us)+3us
154
                      00023                 
155
000C   0000           00024         nop
156
000D   0000           00025         nop
157
000E   0000           00026         nop
158
000F   0000           00027         nop
159
0010   0000           00028         nop
160
0011   0000           00029         nop
161
0012   0B8C           00030         decfsz  yyy, f
162
0013   280C           00031         goto    us10
163
0014   0000           00032         nop
164
0015   0000           00033         nop
165
0016   0000           00034         nop
166
0017   0000           00035         nop
167
0018   0000           00036         nop
168
0019   0008           00037         return
169
                      00038         ;-------------------------
170
                      00039 
171
                      00040 ;----------------------------
172
                      00041 ; Definice promenych
173
                      00042 ;----------------------------
174
                      00043 
175
                      00044         cblock  
176
                      00045 
177
  0000000C            00046         yyy
178
MPASM 02.80 Released            OVLAD.ASM   7-12-2002  20:18:51         PAGE  4
179
 
180
 
181
LOC  OBJECT CODE     LINE SOURCE TEXT
182
  VALUE
183
 
184
  0000000D            00047         xxx
185
                      00048 
186
                      00049         endc
187
                      00050 
188
                      00012         
189
001A                  00013 Start:
190
                      00014         page1
191
001A   1683               M         bsf     STATUS,_RP0
192
001B   3000           00015         movlw   00000000B       ; inicializace citace a prescaleru
193
001C   0081           00016         movwf   TMR0
194
001D   3000           00017         movlw   00000000B       ; konfigurace preruseni
195
001E   008B           00018         movwf   INTCON
196
                      00019 
197
                      00020         page1
198
001F   1683               M         bsf     STATUS,_RP0
199
0020   3000           00021         movlw   00000000B       ; nastaveni portu na vstup nebo vystup
200
0021   0085           00022         movwf   PORTA           ; 1=vstup 0=vystup
201
0022   3043           00023         movlw   01000011B
202
0023   0086           00024         movwf   PORTB
203
                      00025 
204
0024   1781           00026         bsf     TMR0, 7         ; vypni pull-up na PORTB (OPTION registr)
205
                      00027 
206
                      00028         page0
207
0025   1283               M         bcf     STATUS,_RP0
208
                      00029 
209
0026   0103           00030         clrw                    ; vynulovani portu
210
0027   0085           00031         movwf   PORTA
211
0028   0086           00032         movwf   PORTB
212
                      00033 
213
0029                  00034 MainLoop:
214
0029   1586           00035         bsf     PORTB, 3        ; Pridrz napajeni
215
002A   1606           00036         bsf     PORTB, 4
216
002B   1585           00037         bsf     PORTA, 3        ;Rozsvit LED
217
                      00038         
218
                      00039         Delay   250     
219
002C   30FA               M         movlw   250
220
002D   008D               M         movwf   xxx
221
002E   2006               M         call    Delay1ms        
222
                      00040 
223
002F   1185           00041         bcf     PORTA, 3        ;Zhasni LED
224
                      00042 
225
                      00043         Delay   250                     
226
0030   30FA               M         movlw   250
227
0031   008D               M         movwf   xxx
228
0032   2006               M         call    Delay1ms        
229
                      00044 
230
                      00045 
231
0033   1105           00046         bcf     PORTA, 2
232
0034   1085           00047         bcf     PORTA, 1
233
0035                  00048 smycka: 
234
0035   1C06           00049         btfss   PORTB, 0
235
0036   2838           00050         goto    LEDon
236
0037   2835           00051         goto    smycka
237
MPASM 02.80 Released            OVLAD.ASM   7-12-2002  20:18:51         PAGE  5
238
 
239
 
240
LOC  OBJECT CODE     LINE SOURCE TEXT
241
  VALUE
242
 
243
0038                  00052 LEDon:
244
0038   1585           00053         bsf     PORTA, 3        ;Rozsvit LED
245
                      00054         Delay   250             
246
0039   30FA               M         movlw   250
247
003A   008D               M         movwf   xxx
248
003B   2006               M         call    Delay1ms        
249
003C   1185           00055         bcf     PORTA, 3        ;Zhasni LED
250
                      00056         Delay   250             
251
003D   30FA               M         movlw   250
252
003E   008D               M         movwf   xxx
253
003F   2006               M         call    Delay1ms        
254
0040   2835           00057         goto    smycka
255
                      00058         ;---------------
256
                      00059 
257
                      00060 
258
                      00061 
259
                      00062 
260
                      00063 
261
                      00064 ;----------------------------
262
                      00065 ; Definice promenych
263
                      00066 ;----------------------------
264
                      00067 
265
                      00068         cblock  
266
                      00069 
267
  0000000E            00070         CT1
268
  0000000F            00071         CT2
269
                      00072 
270
                      00073         endc
271
                      00074 
272
                      00075         end
273
MPASM 02.80 Released            OVLAD.ASM   7-12-2002  20:18:51         PAGE  6
274
 
275
 
276
SYMBOL TABLE
277
  LABEL                             VALUE 
278
 
279
CMP                               
280
CT1                               0000000E
281
CT2                               0000000F
282
Delay                             
283
Delay1ms                          00000006
284
EEADR_0                           00000009
285
EECON1_1                          00000008
286
EECON2_1                          00000009
287
EEDATA_0                          00000008
288
FSR                               00000004
289
IND0                              00000000
290
INTCON                            0000000B
291
Jednou                            00000005
292
LEDon                             00000038
293
MainLoop                          00000029
294
PCL                               00000002
295
PCLATH                            0000000A
296
PORTA                             00000005
297
PORTB                             00000006
298
SB                                
299
SC                                
300
SN                                
301
SNB                               
302
SNC                               
303
SNZ                               
304
SP                                
305
STATUS                            00000003
306
SZ                                
307
Start                             0000001A
308
TMR0                              00000001
309
_CARRY                            00000000
310
_DC                               00000001
311
_EEIE                             00000006
312
_EEIF                             00000004
313
_EERD                             00000000
314
_EEWR                             00000001
315
_EEWREN                           00000002
316
_EEWRERR                          00000003
317
_GIE                              00000007
318
_INTE                             00000004
319
_INTF                             00000001
320
_IRP                              00000007
321
_PD                               00000003
322
_RBIE                             00000003
323
_RBIF                             00000000
324
_RP0                              00000005
325
_RP1                              00000006
326
_T0IE                             00000005
327
_T0IF                             00000002
328
_TO                               00000004
329
_ZERO                             00000002
330
__16C84__                         00000000
331
__16F84                           00000001
332
MPASM 02.80 Released            OVLAD.ASM   7-12-2002  20:18:51         PAGE  7
333
 
334
 
335
SYMBOL TABLE
336
  LABEL                             VALUE 
337
 
338
page0                             
339
page1                             
340
smycka                            00000035
341
us10                              0000000C
342
xxx                               0000000D
343
yyy                               0000000C
344
 
345
 
346
MEMORY USAGE MAP ('X' = Used,  '-' = Unused)
347
 
348
0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
349
0040 : X--------------- ---------------- ---------------- ----------------
350
 
351
All other memory blocks unused.
352
 
353
Program Memory Words Used:    62
354
Program Memory Words Free:   962
355
 
356
 
357
Errors   :     0
358
Warnings :     0 reported,     0 suppressed
359
Messages :     0 reported,     0 suppressed
360
 
361