-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathled running.lst
506 lines (500 loc) · 25 KB
/
led running.lst
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
HI-TECH Software PIC LITE Macro Assembler V9.71 build 6379
Sun Jul 30 17:57:27 2017
HI-TECH Software Omniscient Code Generator (Lite mode) build 6379
1 0000 opt subtitle "HI-TECH Software Omniscient Code Generator (Lite mode) build 6379"
2
3 opt pagewidth 120
4
5 opt lm
6
7 processor 16F877A
8 clrc macro
9 bcf 3,0
10 0000 endm
11 clrz macro
12 bcf 3,2
13 0000 endm
14 setc macro
15 bsf 3,0
16 0000 endm
17 setz macro
18 bsf 3,2
19 0000 endm
20 skipc macro
21 btfss 3,0
22 0000 endm
23 skipz macro
24 btfss 3,2
25 0000 endm
26 skipnc macro
27 btfsc 3,0
28 0000 endm
29 skipnz macro
30 btfsc 3,2
31 0000 endm
32 0000 indf equ 0
33 0000 indf0 equ 0
34 0002 pc equ 2
35 0002 pcl equ 2
36 0003 status equ 3
37 0004 fsr equ 4
38 0004 fsr0 equ 4
39 0001 c equ 1
40 0000 z equ 0
41 000A pclath equ 10
42 # 2 "D:\TI\PIC course\led running\running.c"
43 psect config,class=CONFIG,delta=2 ;#
44 # 2 "D:\TI\PIC course\led running\running.c"
45 2007 3F7A dw 0x3FFE&0x3F7F&0x3FFF&0x3FFB ;#
46 FNCALL _main,_delay
47 FNROOT _main
48 global _led
49 psect idataCOMMON,class=CODE,space=0,delta=2
50 global __pidataCOMMON
51 0765 __pidataCOMMON:
52 file "D:\TI\PIC course\led running\running.c"
53 line 7
54
55 ;initializer for _led
56 0765 3401 retlw 01h
57 0766 3402 retlw 02h
58 0767 3404 retlw 04h
59 0768 3408 retlw 08h
60 0769 3410 retlw 010h
61 076A 3420 retlw 020h
62 076B 3440 retlw 040h
63 076C 3480 retlw 080h
64 global _PORTB
65 0006 _PORTB set 6
66 global _TRISB
67 0086 _TRISB set 134
68 file "led running.as"
69 line #
70 psect cinit,class=CODE,delta=2
71 global start_initialization
72 0790 start_initialization:
73
74 psect dataCOMMON,class=COMMON,space=1
75 global __pdataCOMMON
76 0070 __pdataCOMMON:
77 file "D:\TI\PIC course\led running\running.c"
78 0070 _led:
79 0070 ds 8
80
81 global btemp
82 psect inittext,class=CODE,delta=2
83 global init_fetch,btemp
84 ; Called with low address in FSR and high address in W
85 076D init_fetch:
86 076D 087E movf btemp,w
87 076E 008A movwf pclath
88 076F 087F movf btemp+1,w
89 0770 0082 movwf pc
90 global init_ram
91 ;Called with:
92 ; high address of idata address in btemp
93 ; low address of idata address in btemp+1
94 ; low address of data in FSR
95 ; high address + 1 of data in btemp-1
96 0771 init_ram:
97 0771 276D 120A 118A fcall init_fetch
98 0774 0080 movwf indf,f
99 0775 0A84 incf fsr,f
100 0776 0804 movf fsr,w
101 0777 067D xorwf btemp-1,w
102 0778 1903 btfsc status,2
103 0779 3400 retlw 0
104 077A 0AFF incf btemp+1,f
105 077B 1903 btfsc status,2
106 077C 0AFE incf btemp,f
107 077D 2F71 goto init_ram
108 ; Initialize objects allocated to COMMON
109 global __pidataCOMMON
110 psect cinit,class=CODE,delta=2
111 0790 120A 118A 2765 fcall __pidataCOMMON+0 ;fetch initializer
120A 118A
112 0795 00F0 movwf __pdataCOMMON+0&07fh
113 0796 120A 118A 2766 fcall __pidataCOMMON+1 ;fetch initializer
120A 118A
114 079B 00F1 movwf __pdataCOMMON+1&07fh
115 079C 120A 118A 2767 fcall __pidataCOMMON+2 ;fetch initializer
120A 118A
116 07A1 00F2 movwf __pdataCOMMON+2&07fh
117 07A2 120A 118A 2768 fcall __pidataCOMMON+3 ;fetch initializer
120A 118A
118 07A7 00F3 movwf __pdataCOMMON+3&07fh
119 07A8 120A 118A 2769 fcall __pidataCOMMON+4 ;fetch initializer
120A 118A
120 07AD 00F4 movwf __pdataCOMMON+4&07fh
121 07AE 120A 118A 276A fcall __pidataCOMMON+5 ;fetch initializer
120A 118A
122 07B3 00F5 movwf __pdataCOMMON+5&07fh
123 07B4 120A 118A 276B fcall __pidataCOMMON+6 ;fetch initializer
120A 118A
124 07B9 00F6 movwf __pdataCOMMON+6&07fh
125 07BA 120A 118A 276C fcall __pidataCOMMON+7 ;fetch initializer
120A 118A
126 07BF 00F7 movwf __pdataCOMMON+7&07fh
127 psect cinit,class=CODE,delta=2
128 global end_of_initialization
129
130 ;End of C runtime variable initationation code
131
132 07C0 end_of_initialization:
133 07C0 0183 clrf status
134 07C1 120A 118A 2FC4 ljmp _main ;jump to C main() function
135 psect cstackCOMMON,class=COMMON,space=1
136 global __pcstackCOMMON
137 0078 __pcstackCOMMON:
138 global ?_delay
139 0078 ?_delay: ; 0 bytes @ 0x0
140 global ?_main
141 0078 ?_main: ; 0 bytes @ 0x0
142 global delay@a
143 0078 delay@a: ; 2 bytes @ 0x0
144 0078 ds 2
145 global ??_delay
146 007A ??_delay: ; 0 bytes @ 0x2
147 global ??_main
148 007A ??_main: ; 0 bytes @ 0x2
149 global main@i
150 007A main@i: ; 2 bytes @ 0x2
151 007A ds 2
152 ;;Data sizes: Strings 0, constant 0, data 8, bss 0, persistent 0 stack 0
153 ;;Auto spaces: Size Autos Used
154 ;; COMMON 14 4 12
155 ;; BANK0 80 0 0
156 ;; BANK1 80 0 0
157 ;; BANK3 96 0 0
158 ;; BANK2 96 0 0
159
160 ;;
161 ;; Pointer list with targets:
162
163
164
165 ;; Critical Paths (_main)
166 ;; COMMON: _main->_delay
167
168 ;;
169 ;;Main: autosize = 0, tempsize = 0, incstack = 0, save=0
170
171 ;;
172 ;;Call Graph Tables:
173
174 ;; ---------------------------------------------------------------------------------
175 ;; (Depth) Function Calls Base Space Used Autos Params Refs
176 ;; ---------------------------------------------------------------------------------
177 ;; (0) _main 2 2 0 60
178 ;; 2 COMMON 2 2 0
179 ;; _delay
180 ;; ---------------------------------------------------------------------------------
181 ;; (4294967295) _delay 2 0 2 15
182 ;; 0 COMMON 2 0 2
183 ;; ---------------------------------------------------------------------------------
184 ;; Estimated maximum call depth -1
185 ;; ---------------------------------------------------------------------------------
186
187 ;; Call Graph Graphs:
188
189 ;; _main (ROOT)
190 ;; _delay
191 ;;
192
193 ;; Address spaces:
194
195 ;;Name Size Autos Total Cost Usage
196 ;;BANK3 60 0 0 8 0.0%
197 ;;SFR3 0 0 0 4 0.0%
198 ;;BITSFR3 0 0 0 4 0.0%
199 ;;BITBANK3 60 0 0 11 0.0%
200 ;;BITSFR2 0 0 0 5 0.0%
201 ;;SFR2 0 0 0 5 0.0%
202 ;;BITBANK2 60 0 0 12 0.0%
203 ;;BANK2 60 0 0 9 0.0%
204 ;;SFR1 0 0 0 2 0.0%
205 ;;BITBANK1 50 0 0 6 0.0%
206 ;;BANK1 50 0 0 7 0.0%
207 ;;BITSFR1 0 0 0 2 0.0%
208 ;;ABS 0 0 C 10 0.0%
209 ;;DATA 0 0 D 5 0.0%
210 ;;SFR0 0 0 0 1 0.0%
211 ;;NULL 0 0 0 0 0.0%
212 ;;CODE 0 0 0 0 0.0%
213 ;;BITSFR0 0 0 0 1 0.0%
214 ;;BITBANK0 50 0 0 3 0.0%
215 ;;BANK0 50 0 0 4 0.0%
216 ;;STACK 0 0 1 2 0.0%
217 ;;BITCOMMON E 0 0 0 0.0%
218 ;;COMMON E 4 C 1 85.7%
219 ;;EEDATA 100 0 0 0 0.0%
220
221 global _main
222 psect maintext,global,class=CODE,delta=2
223 global __pmaintext
224 07C4 __pmaintext:
225
226 ;; *************** function _main *****************
227 ;; Defined at:
228 ;; line 9 in file "D:\TI\PIC course\led running\running.c"
229 ;; Parameters: Size Location Type
230 ;; None
231 ;; Auto vars: Size Location Type
232 ;; i 2 2[COMMON] int
233 ;; Return value: Size Location Type
234 ;; None void
235 ;; Registers used:
236 ;; wreg, fsr0l, fsr0h, status,2, status,0, btemp+0, pclath, cstack
237 ;; Tracked objects:
238 ;; On entry : 17F/0
239 ;; On exit : 0/0
240 ;; Unchanged: 0/0
241 ;; Data sizes: COMMON BANK0 BANK1 BANK3 BANK2
242 ;; Params: 0 0 0 0 0
243 ;; Locals: 2 0 0 0 0
244 ;; Temps: 0 0 0 0 0
245 ;; Totals: 2 0 0 0 0
246 ;;Total ram usage: 2 bytes
247 ;; Hardware stack levels required when called: 1
248 ;; This function calls:
249 ;; _delay
250 ;; This function is called by:
251 ;; Startup code after reset
252 ;; This function uses a non-reentrant model
253 ;;
254 psect maintext
255 file "D:\TI\PIC course\led running\running.c"
256 line 9
257 global __size_of_main
258 003C __size_of_main equ __end_of_main-_main
259
260 07C4 _main:
261 opt stack 1
262 ; Regs used in _main: [wreg-fsr0h+status,2-btemp+0+pclath+cstack]
263 line 10
264
265 07C4 l1731:
266 ;running.c: 10: TRISB=0x00;
267 07C4 1683 bsf status, 5 ;RP0=1, select bank1
268 07C5 1303 bcf status, 6 ;RP1=0, select bank1
269 07C6 0186 clrf (134)^080h ;volatile
270 line 11
271 ;running.c: 11: while(1)
272
273 07C7 l567:
274 line 13
275
276 07C7 l1733:
277 ;running.c: 12: {
278 ;running.c: 13: for(int i=0;i<8;i++)
279 07C7 3000 movlw low(0)
280 07C8 00FA movwf (main@i)
281 07C9 3000 movlw high(0)
282 07CA 00FB movwf ((main@i))+1
283
284 07CB l1735:
285 07CB 087B movf (main@i+1),w
286 07CC 3A80 xorlw 80h
287 07CD 00FE movwf btemp+0
288 07CE 3080 movlw (high(08h))^80h
289 07CF 027E subwf btemp+0,w
290 07D0 1D03 skipz
291 07D1 2FD4 goto u2155
292 07D2 3008 movlw low(08h)
293 07D3 027A subwf (main@i),w
294 07D4 u2155:
295
296 07D4 1C03 skipc
297 07D5 2FD7 goto u2151
298 07D6 2FD8 goto u2150
299 07D7 u2151:
300 07D7 2FD9 goto l568
301 07D8 u2150:
302
303 07D8 l1737:
304 07D8 2FFC goto l569
305 line 14
306
307 07D9 l568:
308 line 15
309
310 07D9 l1739:
311 ;running.c: 14: {
312 ;running.c: 15: PORTB=led[i];
313 07D9 087A movf (main@i),w
314 07DA 3E70 addlw _led&0ffh
315 07DB 0084 movwf fsr0
316 07DC 0800 movf indf,w
317 07DD 1283 bcf status, 5 ;RP0=0, select bank0
318 07DE 1303 bcf status, 6 ;RP1=0, select bank0
319 07DF 0086 movwf (6) ;volatile
320 line 16
321
322 07E0 l1741:
323 ;running.c: 16: delay(20000);
324 07E0 3020 movlw low(04E20h)
325 07E1 00F8 movwf (?_delay)
326 07E2 304E movlw high(04E20h)
327 07E3 00F9 movwf ((?_delay))+1
328 07E4 120A 118A 277E fcall _delay
120A 118A
329 line 13
330
331 07E9 l1743:
332 07E9 3001 movlw low(01h)
333 07EA 07FA addwf (main@i),f
334 07EB 1803 skipnc
335 07EC 0AFB incf (main@i+1),f
336 07ED 3000 movlw high(01h)
337 07EE 07FB addwf (main@i+1),f
338
339 07EF l1745:
340 07EF 087B movf (main@i+1),w
341 07F0 3A80 xorlw 80h
342 07F1 00FE movwf btemp+0
343 07F2 3080 movlw (high(08h))^80h
344 07F3 027E subwf btemp+0,w
345 07F4 1D03 skipz
346 07F5 2FF8 goto u2165
347 07F6 3008 movlw low(08h)
348 07F7 027A subwf (main@i),w
349 07F8 u2165:
350
351 07F8 1C03 skipc
352 07F9 2FFB goto u2161
353 07FA 2FFC goto u2160
354 07FB u2161:
355 07FB 2FD9 goto l568
356 07FC u2160:
357
358 07FC l569:
359 line 19
360
361 07FC l570:
362 line 11
363 07FC 2FC7 goto l567
364
365 07FD l571:
366 line 21
367
368 07FD l572:
369 global start
370 07FD 120A 118A 2800 ljmp start
371 opt stack 0
372 GLOBAL __end_of_main
373 0800 __end_of_main:
374 ;; =============== function _main ends ============
375
376 signat _main,88
377 global _delay
378 psect text56,local,class=CODE,delta=2
379 global __ptext56
380 077E __ptext56:
381
382 ;; *************** function _delay *****************
383 ;; Defined at:
384 ;; line 4 in file "D:\TI\PIC course\led running\running.c"
385 ;; Parameters: Size Location Type
386 ;; a 2 0[COMMON] unsigned int
387 ;; Auto vars: Size Location Type
388 ;; None
389 ;; Return value: Size Location Type
390 ;; None void
391 ;; Registers used:
392 ;; wreg
393 ;; Tracked objects:
394 ;; On entry : 0/0
395 ;; On exit : 0/0
396 ;; Unchanged: 0/0
397 ;; Data sizes: COMMON BANK0 BANK1 BANK3 BANK2
398 ;; Params: 2 0 0 0 0
399 ;; Locals: 0 0 0 0 0
400 ;; Temps: 0 0 0 0 0
401 ;; Totals: 2 0 0 0 0
402 ;;Total ram usage: 2 bytes
403 ;; Hardware stack levels used: 1
404 ;; This function calls:
405 ;; Nothing
406 ;; This function is called by:
407 ;; _main
408 ;; This function uses a non-reentrant model
409 ;;
410 psect text56
411 file "D:\TI\PIC course\led running\running.c"
412 line 4
413 global __size_of_delay
414 0012 __size_of_delay equ __end_of_delay-_delay
415
416 077E _delay:
417 opt stack 0
418 ; Regs used in _delay: [wreg]
419 line 5
420
421 077E l1499:
422 ;running.c: 5: while(a--);
423 077E 2F7F goto l561
424
425 077F l562:
426
427 077F l561:
428
429 077F l1501:
430 077F 3001 movlw low(01h)
431 0780 02F8 subwf (delay@a),f
432 0781 3000 movlw high(01h)
433 0782 1C03 skipc
434 0783 03F9 decf (delay@a+1),f
435 0784 02F9 subwf (delay@a+1),f
436 0785 30FF movlw high(0FFFFh)
437 0786 0679 xorwf ((delay@a+1)),w
438 0787 1D03 skipz
439 0788 2F8B goto u1535
440 0789 30FF movlw low(0FFFFh)
441 078A 0678 xorwf ((delay@a)),w
442 078B u1535:
443
444 078B 1D03 skipz
445 078C 2F8E goto u1531
446 078D 2F8F goto u1530
447 078E u1531:
448 078E 2F7F goto l562
449 078F u1530:
450
451 078F l563:
452 line 6
453
454 078F l564:
455 078F 0008 return
456 opt stack 0
457 GLOBAL __end_of_delay
458 0790 __end_of_delay:
459 ;; =============== function _delay ends ============
460
461 signat _delay,4216
462 psect text57,local,class=CODE,delta=2
463 global __ptext57
464 0000 __ptext57:
465 global btemp
466 007E btemp set 07Eh
467
468 DABS 1,126,2 ;btemp
469 global wtemp0
470 007E wtemp0 set btemp
HI-TECH Software PICC Macro Assembler V9.71 build 6379
Symbol Table Sun Jul 30 17:57:27 2017
pc 0002 __size_of_delay 0012 fsr 0004 l561 077F
l562 077F l570 07FC l563 078F l571 07FD
l564 078F l572 07FD l567 07C7 l568 07D9
l569 07FC _led 0070 fsr0 0004 indf 0000
??_delay 007A l1501 077F l1731 07C4 l1741 07E0
l1733 07C7 l1743 07E9 l1735 07CB l1745 07EF
l1737 07D8 l1499 077E l1739 07D9 __ptext56 077E
__ptext57 0000 u2150 07D8 u2151 07D7 u2160 07FC
u2161 07FB u1530 078F u1531 078E u2155 07D4
u2165 07F8 u1535 078B _main 07C4 btemp 007E
start 0000 start_initialization 0790 ?_main 0078 __end_of_delay 0790
_PORTB 0006 _TRISB 0086 __pidataCOMMON 0765 __pcstackCOMMON 0078
_delay 077E main@i 007A pclath 000A status 0003
wtemp0 007E __size_of_main 003C ??_main 007A __pmaintext 07C4
?_delay 0078 __end_of_main 0800 end_of_initialization 07C0 init_ram 0771
delay@a 0078 init_fetch 076D __pdataCOMMON 0070