📄 fil10.lst
字号:
245 .area CSEG (CODE)
002C 246 __sdcc_program_startup:
002C 12s00r98 247 lcall _main
248 ; return from main will lock up
002F 80 FE 249 sjmp .
250 ;------------------------------------------------------------
251 ;Allocation info for local variables in function 'count'
252 ;------------------------------------------------------------
253 ;------------------------------------------------------------
254 ;c:/hj51avr/code/c/fil10.c:37: void count (void) interrupt 0 {
255 ; -----------------------------------------
256 ; function count
257 ; -----------------------------------------
0031 258 _count:
0002 259 ar2 = 0x02
0003 260 ar3 = 0x03
0004 261 ar4 = 0x04
0005 262 ar5 = 0x05
0006 263 ar6 = 0x06
0007 264 ar7 = 0x07
0000 265 ar0 = 0x00
0001 266 ar1 = 0x01
0031 C0 E0 267 push acc
0033 C0 F0 268 push b
0035 C0 82 269 push dpl
0037 C0 83 270 push dph
0039 C0 D0 271 push psw
003B 75 D0 00 272 mov psw,#0x00
273 ;c:/hj51avr/code/c/fil10.c:38: Counts++; //结果只是简单地增加计数值
274 ; genPlus
275 ; genPlusIncr
003E 05*00 276 inc _Counts
0040 E4 277 clr a
0041 B5*00 0C 278 cjne a,_Counts,00103$
0044 05*01 279 inc (_Counts + 1)
0046 B5*01 07 280 cjne a,(_Counts + 1),00103$
0049 05*02 281 inc (_Counts + 2)
004B B5*02 02 282 cjne a,(_Counts + 2),00103$
004E 05*03 283 inc (_Counts + 3)
0050 284 00103$:
0050 285 00101$:
0050 D0 D0 286 pop psw
0052 D0 83 287 pop dph
0054 D0 82 288 pop dpl
0056 D0 F0 289 pop b
0058 D0 E0 290 pop acc
005A 32 291 reti
292 ;------------------------------------------------------------
293 ;Allocation info for local variables in function 'timer'
294 ;------------------------------------------------------------
295 ;------------------------------------------------------------
296 ;c:/hj51avr/code/c/fil10.c:41: void timer(void) interrupt 1{
297 ; -----------------------------------------
298 ; function timer
299 ; -----------------------------------------
005B 300 _timer:
005B C0 E0 301 push acc
005D C0 F0 302 push b
005F C0 82 303 push dpl
0061 C0 83 304 push dph
0063 C0 D0 305 push psw
0065 75 D0 00 306 mov psw,#0x00
307 ;c:/hj51avr/code/c/fil10.c:42: TH0 = 0;
308 ; genAssign
0068 75 8C 00 309 mov _TH0,#0x00
310 ;c:/hj51avr/code/c/fil10.c:43: TL0 = 0;
311 ; genAssign
006B 75 8A 00 312 mov _TL0,#0x00
313 ;c:/hj51avr/code/c/fil10.c:44: times ++;
314 ; genPlus
315 ; genPlusIncr
006E 05*08 316 inc _times
317 ;c:/hj51avr/code/c/fil10.c:46: if(times == 10)
318 ; genCmpEq
0070 E5*08 319 mov a,_times
320 ; Peephole 112.b changed ljmp to sjmp
321 ; Peephole 199 optimized misc jump sequence
0072 B4 0A 18 322 cjne a,#0x0A,00103$
323 ;00106$:
324 ; Peephole 200 removed redundant sjmp
0075 325 00107$:
326 ;c:/hj51avr/code/c/fil10.c:48: scount = Counts;
327 ; genAssign
0075 85*00*04 328 mov _scount,_Counts
0078 85*01*05 329 mov (_scount + 1),(_Counts + 1)
007B 85*02*06 330 mov (_scount + 2),(_Counts + 2)
007E 85*03*07 331 mov (_scount + 3),(_Counts + 3)
332 ;c:/hj51avr/code/c/fil10.c:49: Counts = 0;
333 ; genAssign
0081 E4 334 clr a
0082 F5*03 335 mov (_Counts + 3),a
0084 F5*02 336 mov (_Counts + 2),a
0086 F5*01 337 mov (_Counts + 1),a
0088 F5*00 338 mov _Counts,a
339 ;c:/hj51avr/code/c/fil10.c:50: times = 0;
340 ; genAssign
008A 75*08 00 341 mov _times,#0x00
008D 342 00103$:
008D D0 D0 343 pop psw
008F D0 83 344 pop dph
0091 D0 82 345 pop dpl
0093 D0 F0 346 pop b
0095 D0 E0 347 pop acc
0097 32 348 reti
349 ;------------------------------------------------------------
350 ;Allocation info for local variables in function 'main'
351 ;------------------------------------------------------------
352 ;------------------------------------------------------------
353 ;c:/hj51avr/code/c/fil10.c:54: void main()
354 ; -----------------------------------------
355 ; function main
356 ; -----------------------------------------
0098 357 _main:
358 ;c:/hj51avr/code/c/fil10.c:57: P1 = 255; //关闭LED显示
359 ; genAssign
0098 75 90 FF 360 mov _P1,#0xFF
361 ;c:/hj51avr/code/c/fil10.c:58: P0 = 0; //关闭数码显示
362 ; genAssign
009B 75 80 00 363 mov _P0,#0x00
364 ;c:/hj51avr/code/c/fil10.c:59: P2 = 255; //
365 ; genAssign
009E 75 A0 FF 366 mov _P2,#0xFF
367 ;c:/hj51avr/code/c/fil10.c:60: P3_7 = 0; //关闭蜂鸣器
368 ; genAssign
00A1 C2 B7 369 clr _P3_7
370 ;c:/hj51avr/code/c/fil10.c:62: Counts = 0;
371 ; genAssign
00A3 E4 372 clr a
00A4 F5*03 373 mov (_Counts + 3),a
00A6 F5*02 374 mov (_Counts + 2),a
00A8 F5*01 375 mov (_Counts + 1),a
00AA F5*00 376 mov _Counts,a
377 ;c:/hj51avr/code/c/fil10.c:63: times = 0;
378 ; genAssign
00AC 75*08 00 379 mov _times,#0x00
380 ;c:/hj51avr/code/c/fil10.c:65: ET0 = 1; // 外部计数触发方式下降沿方式
381 ; genAssign
00AF D2 A9 382 setb _ET0
383 ;c:/hj51avr/code/c/fil10.c:66: TMOD = 0x01; // 计数器工作在方式 0
384 ; genAssign
00B1 75 89 01 385 mov _TMOD,#0x01
386 ;c:/hj51avr/code/c/fil10.c:67: EX0 = 1;
387 ; genAssign
00B4 D2 A8 388 setb _EX0
389 ;c:/hj51avr/code/c/fil10.c:68: TR0 =1; //打开定时器T0
390 ; genAssign
00B6 D2 8C 391 setb _TR0
392 ;c:/hj51avr/code/c/fil10.c:71: EA =1; // 中断总允许
393 ; genAssign
00B8 D2 AF 394 setb _EA
395 ;c:/hj51avr/code/c/fil10.c:75: while(1) //设置一个无限制循环
00BA 396 00102$:
397 ;c:/hj51avr/code/c/fil10.c:77: P1_0 =~P1_0; //翻转 P1.0 作为外部中断源
398 ; genCpl
399 ; Peephole 167 removed redundant bit moves (c not set to _P1_0)
00BA B2 90 400 cpl _P1_0
401 ;c:/hj51avr/code/c/fil10.c:79: DIS_NUM(scount);
402 ; genCast
00BC 85*04 82 403 mov dpl,_scount
00BF 85*05 83 404 mov dph,(_scount + 1)
405 ; genCall
00C2 12s01r2C 406 lcall _DIS_NUM
407 ; Peephole 112.b changed ljmp to sjmp
00C5 80 F3 408 sjmp 00102$
00C7 409 00104$:
00C7 22 410 ret
411 ;------------------------------------------------------------
412 ;Allocation info for local variables in function 'delay'
413 ;------------------------------------------------------------
414 ;times Allocated to registers r2
415 ;t Allocated to registers r3 r4
416 ;i Allocated to registers
417 ;------------------------------------------------------------
418 ;c:/hj51avr/code/c/fil10.c:86: void delay(unsigned char times)
419 ; -----------------------------------------
420 ; function delay
421 ; -----------------------------------------
00C8 422 _delay:
423 ; genReceive
00C8 AA 82 424 mov r2,dpl
425 ;c:/hj51avr/code/c/fil10.c:88: int t=15000; //延时倍数
426 ; genAssign
00CA 7B 98 427 mov r3,#0x98
00CC 7C 3A 428 mov r4,#0x3A
429 ;c:/hj51avr/code/c/fil10.c:89: unsigned char i=times;
430 ; genAssign
00CE 431 00105$:
432 ;c:/hj51avr/code/c/fil10.c:90: for(;i!=0;i--)
433 ; genCmpEq
00CE BA 00 02 434 cjne r2,#0x00,00114$
435 ; Peephole 112.b changed ljmp to sjmp
00D1 80 1E 436 sjmp 00109$
00D3 437 00114$:
438 ; genAssign
00D3 8B 05 439 mov ar5,r3
00D5 8C 06 440 mov ar6,r4
00D7 441 00101$:
442 ;c:/hj51avr/code/c/fil10.c:91: {for(;t!=0;t--){}}
443 ; genCmpEq
444 ; Peephole 241.b optimized compare
00D7 E4 445 clr a
00D8 BD 00 04 446 cjne r5,#0x00,00115$
00DB BE 00 01 447 cjne r6,#0x00,00115$
00DE 04 448 inc a
00DF 449 00115$:
00DF 450 00116$:
00DF FF 451 mov r7,a
452 ; genAssign
00E0 8D 03 453 mov ar3,r5
00E2 8E 04 454 mov ar4,r6
455 ; genIfx
00E4 EF 456 mov a,r7
457 ; genIfxJump
458 ; Peephole 109 removed ljmp by inverse jump logic
00E5 70 07 459 jnz 00107$
00E7 460 00117$:
461 ; genMinus
462 ; genMinusDec
463 ; tail decrement optimized
00E7 1D 464 dec r5
00E8 BD FF EC 465 cjne r5,#0xff,00101$
00EB 1E 466 dec r6
467 ; Peephole 112.b changed ljmp to sjmp
00EC 80 E9 468 sjmp 00101$
00EE 469 00107$:
470 ;c:/hj51avr/code/c/fil10.c:90: for(;i!=0;i--)
471 ; genMinus
472 ; genMinusDec
00EE 1A 473 dec r2
474 ; Peephole 112.b changed ljmp to sjmp
00EF 80 DD 475 sjmp 00105$
00F1 476 00109$:
00F1 22 477 ret
478 ;------------------------------------------------------------
479 ;Allocation info for local variables in function 'display'
480 ;------------------------------------------------------------
481 ;disdata Allocated with name '_display_PARM_2'
482 ;disseg Allocated to registers r2
483 ;dataf Allocated to registers r3
484 ;------------------------------------------------------------
485 ;c:/hj51avr/code/c/fil10.c:101: void display(unsigned char disseg,unsigned char disdata)
486 ; -----------------------------------------
487 ; function display
488 ; -----------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -