📄 main.lst
字号:
400 0108 60E0 ldi r22,lo8(0)
401 010a 8CE0 ldi r24,lo8(12)
402 .L144:
403 010c 0E94 0000 call w_lcd
404 0110 60E0 ldi r22,lo8(0)
405 0112 86E0 ldi r24,lo8(6)
406 .L143:
407 0114 0E94 0000 call w_lcd
408 0118 0895 ret
409 .L136:
87:./LCD1602.c **** w_lcd(0x06,com);
88:./LCD1602.c **** else if(way==2) //显视光标,光标交烁,光标、数据指针加1;
411 .LM39:
412 011a 8230 cpi r24,lo8(2)
413 011c 19F4 brne .L138
89:./LCD1602.c **** w_lcd(0x0f,com),
415 .LM40:
416 011e 60E0 ldi r22,lo8(0)
417 0120 8FE0 ldi r24,lo8(15)
418 0122 F4CF rjmp .L144
419 .L138:
90:./LCD1602.c **** w_lcd(0x06,com);
91:./LCD1602.c **** else if(way==3) //不显视光标,光标不移动,屏幕左移
421 .LM41:
422 0124 8330 cpi r24,lo8(3)
423 0126 39F4 brne .L140
92:./LCD1602.c **** w_lcd(0x0c,com),
425 .LM42:
426 0128 60E0 ldi r22,lo8(0)
427 012a 8CE0 ldi r24,lo8(12)
428 012c 0E94 0000 call w_lcd
429 0130 60E0 ldi r22,lo8(0)
430 0132 87E0 ldi r24,lo8(7)
431 0134 EFCF rjmp .L143
432 .L140:
93:./LCD1602.c **** w_lcd(0x07,com);
94:./LCD1602.c **** else if(way==4) //显视光标,光标不移动,屏幕左移
434 .LM43:
435 0136 8430 cpi r24,lo8(4)
436 0138 41F4 brne .L133
95:./LCD1602.c **** w_lcd(0x0f,com),
438 .LM44:
439 013a 60E0 ldi r22,lo8(0)
440 013c 8FE0 ldi r24,lo8(15)
441 013e 0E94 0000 call w_lcd
442 0142 60E0 ldi r22,lo8(0)
443 0144 87E0 ldi r24,lo8(7)
444 0146 0E94 0000 call w_lcd
445 .L133:
446 014a 0895 ret
447 /* epilogue: frame size=0 */
448 /* epilogue: noreturn */
449 /* epilogue end (size=0) */
450 /* function set size 41 (41) */
452 .Lscope7:
456 .global wsc
458 wsc:
96:./LCD1602.c **** w_lcd(0x07,com);
97:./LCD1602.c **** }
98:./LCD1602.c ****
99:./LCD1602.c **** /*void ws(uchar str0[40],char str1[40]) //写字符串
100:./LCD1602.c **** { uchar i;
101:./LCD1602.c **** ini(); //初始化
102:./LCD1602.c **** set(1); //设置显视方式
103:./LCD1602.c **** go(0,0);
104:./LCD1602.c **** for(i=0;str0[i]!='\0';i++)
105:./LCD1602.c **** w_lcd(str0[i],dat);
106:./LCD1602.c **** go(0,1);
107:./LCD1602.c **** for(i=0;str1[i]!='\0';i++)
108:./LCD1602.c **** w_lcd(str1[i],dat);
109:./LCD1602.c **** } //*/
110:./LCD1602.c ****
111:./LCD1602.c **** void wsc(const char str0[40],const char str1[40]) //写字符串
112:./LCD1602.c **** { uchar i;
460 .LM45:
461 /* prologue: frame size=0 */
462 014c EF92 push r14
463 014e FF92 push r15
464 0150 1F93 push r17
465 0152 CF93 push r28
466 0154 DF93 push r29
467 /* prologue end (size=5) */
468 0156 EC01 movw r28,r24
469 0158 7B01 movw r14,r22
113:./LCD1602.c **** ini(); //初始化
471 .LM46:
472 015a 0E94 0000 call ini
114:./LCD1602.c **** set(1); //设置显视方式
474 .LM47:
475 015e 81E0 ldi r24,lo8(1)
476 0160 0E94 0000 call set
115:./LCD1602.c **** go(0,0);
478 .LM48:
479 0164 60E0 ldi r22,lo8(0)
480 0166 862F mov r24,r22
481 0168 0E94 0000 call go
116:./LCD1602.c **** for(i=0;str0[i]!='\0';i++)
483 .LM49:
484 016c 10E0 ldi r17,lo8(0)
485 016e 8881 ld r24,Y
486 .L158:
488 .LM50:
489 0170 8823 tst r24
490 0172 69F0 breq .L155
117:./LCD1602.c **** w_lcd(str0[i],dat);
492 .LM51:
493 0174 FE01 movw r30,r28
494 0176 E10F add r30,r17
495 0178 F11D adc r31,__zero_reg__
496 017a 61E0 ldi r22,lo8(1)
497 017c 8081 ld r24,Z
498 017e 0E94 0000 call w_lcd
500 .LM52:
501 0182 1F5F subi r17,lo8(-(1))
502 0184 FE01 movw r30,r28
503 0186 E10F add r30,r17
504 0188 F11D adc r31,__zero_reg__
505 018a 8081 ld r24,Z
506 018c F1CF rjmp .L158
507 .L155:
118:./LCD1602.c **** go(0,1);
509 .LM53:
510 018e 61E0 ldi r22,lo8(1)
511 0190 80E0 ldi r24,lo8(0)
512 0192 0E94 0000 call go
119:./LCD1602.c **** for(i=0;str1[i]!='\0';i++)
514 .LM54:
515 0196 10E0 ldi r17,lo8(0)
516 0198 F701 movw r30,r14
517 019a 8081 ld r24,Z
518 019c 8823 tst r24
519 019e 71F0 breq .L157
520 .L153:
120:./LCD1602.c **** w_lcd(str1[i],dat);
522 .LM55:
523 01a0 F701 movw r30,r14
524 01a2 E10F add r30,r17
525 01a4 F11D adc r31,__zero_reg__
526 01a6 61E0 ldi r22,lo8(1)
527 01a8 8081 ld r24,Z
528 01aa 0E94 0000 call w_lcd
530 .LM56:
531 01ae 1F5F subi r17,lo8(-(1))
532 01b0 F701 movw r30,r14
533 01b2 E10F add r30,r17
534 01b4 F11D adc r31,__zero_reg__
535 01b6 8081 ld r24,Z
536 01b8 8823 tst r24
537 01ba 91F7 brne .L153
538 .L157:
539 /* epilogue: frame size=0 */
540 01bc DF91 pop r29
541 01be CF91 pop r28
542 01c0 1F91 pop r17
543 01c2 FF90 pop r15
544 01c4 EF90 pop r14
545 01c6 0895 ret
546 /* epilogue end (size=6) */
547 /* function wsc size 62 (51) */
552 .Lscope8:
554 .global ini_ds
556 ini_ds:
558 .Ltext2:
1:./ds18b20A.c **** #include <avr/io.h>
2:./ds18b20A.c **** #include <avr/interrupt.h>
3:./ds18b20A.c **** #include <avr/signal.h>
4:./ds18b20A.c **** #include <avr/eeprom.h>
5:./ds18b20A.c ****
6:./ds18b20A.c **** #define CPU_CRYSTAL (7.3728) //CPU Ck
7:./ds18b20A.c **** #define dy(us)\
8:./ds18b20A.c **** _delay_loop_2((uint)((us)*CPU_CRYSTAL/4))
9:./ds18b20A.c ****
10:./ds18b20A.c ****
11:./ds18b20A.c **** #define Q_s DDRD&=~0x08 //DQ float
12:./ds18b20A.c **** #define Q_c DDRD|=0x08 //DQ =0
13:./ds18b20A.c **** #define Q_a (PIND&0x08) //read DQ
14:./ds18b20A.c ****
15:./ds18b20A.c **** void ini_ds(void)
16:./ds18b20A.c **** { DDRD &= ~0x08; // 输入模式(上电时为高电平)
560 .LM57:
561 /* prologue: frame size=0 */
562 /* prologue end (size=0) */
563 01c8 8B98 cbi 49-0x20,3
17:./ds18b20A.c **** PORTD &= ~0x08; // 输出锁存器写0,以后不再更改
565 .LM58:
566 01ca 9398 cbi 50-0x20,3
567 /* epilogue: frame size=0 */
568 01cc 0895 ret
569 /* epilogue end (size=1) */
570 /* function ini_ds size 3 (2) */
572 .Lscope9:
574 .global rt_ds
576 rt_ds:
18:./ds18b20A.c **** }
19:./ds18b20A.c ****
20:./ds18b20A.c **** uchar rt_ds(void) //rest ds18b20
21:./ds18b20A.c **** {uchar ret; //return data
578 .LM59:
579 /* prologue: frame size=0 */
580 /* prologue end (size=0) */
22:./ds18b20A.c **** ret=0;
23:./ds18b20A.c **** Q_c;
582 .LM60:
583 01ce 8B9A sbi 49-0x20,3
584 .LBB2:
586 .Ltext3:
1:E:/WinAVR/avr/include/util/delay.h **** /* Copyright (c) 2002, Marek Michalkiewicz
2:E:/WinAVR/avr/include/util/delay.h **** Copyright (c) 2004,2005 Joerg Wunsch
3:E:/WinAVR/avr/include/util/delay.h **** All rights reserved.
4:E:/WinAVR/avr/include/util/delay.h ****
5:E:/WinAVR/avr/include/util/delay.h **** Redistribution and use in source and binary forms, with or without
6:E:/WinAVR/avr/include/util/delay.h **** modification, are permitted provided that the following conditions are met:
7:E:/WinAVR/avr/include/util/delay.h ****
8:E:/WinAVR/avr/include/util/delay.h **** * Redistributions of source code must retain the above copyright
9:E:/WinAVR/avr/include/util/delay.h **** notice, this list of conditions and the following disclaimer.
10:E:/WinAVR/avr/include/util/delay.h ****
11:E:/WinAVR/avr/include/util/delay.h **** * Redistributions in binary form must reproduce the above copyright
12:E:/WinAVR/avr/include/util/delay.h **** notice, this list of conditions and the following disclaimer in
13:E:/WinAVR/avr/include/util/delay.h **** the documentation and/or other materials provided with the
14:E:/WinAVR/avr/include/util/delay.h **** distribution.
15:E:/WinAVR/avr/include/util/delay.h ****
16:E:/WinAVR/avr/include/util/delay.h **** * Neither the name of the copyright holders nor the names of
17:E:/WinAVR/avr/include/util/delay.h **** contributors may be used to endorse or promote products derived
18:E:/WinAVR/avr/include/util/delay.h **** from this software without specific prior written permission.
19:E:/WinAVR/avr/include/util/delay.h ****
20:E:/WinAVR/avr/include/util/delay.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21:E:/WinAVR/avr/include/util/delay.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22:E:/WinAVR/avr/include/util/delay.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23:E:/WinAVR/avr/include/util/delay.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24:E:/WinAVR/avr/include/util/delay.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25:E:/WinAVR/avr/include/util/delay.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26:E:/WinAVR/avr/include/util/delay.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27:E:/WinAVR/avr/include/util/delay.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28:E:/WinAVR/avr/include/util/delay.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29:E:/WinAVR/avr/include/util/delay.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30:E:/WinAVR/avr/include/util/delay.h **** POSSIBILITY OF SUCH DAMAGE. */
31:E:/WinAVR/avr/include/util/delay.h ****
32:E:/WinAVR/avr/include/util/delay.h **** /* $Id: delay.h,v 1.1.2.1 2005/12/12 23:19:49 joerg_wunsch Exp $ */
33:E:/WinAVR/avr/include/util/delay.h ****
34:E:/WinAVR/avr/include/util/delay.h **** #ifndef _UTIL_DELAY_H_
35:E:/WinAVR/avr/include/util/delay.h **** #define _UTIL_DELAY_H_ 1
36:E:/WinAVR/avr/include/util/delay.h ****
37:E:/WinAVR/avr/include/util/delay.h **** #include <inttypes.h>
38:E:/WinAVR/avr/include/util/delay.h ****
39:E:/WinAVR/avr/include/util/delay.h **** /** \defgroup util_delay <util/delay.h>: Busy-wait delay loops
40:E:/WinAVR/avr/include/util/delay.h **** \code
41:E:/WinAVR/avr/include/util/delay.h **** #define F_CPU 1000000UL // 1 MHz
42:E:/WinAVR/avr/include/util/delay.h **** //#define F_CPU 14.7456E6
43:E:/WinAVR/avr/include/util/delay.h **** #include <util/delay.h>
44:E:/WinAVR/avr/include/util/delay.h **** \endcode
45:E:/WinAVR/avr/include/util/delay.h ****
46:E:/WinAVR/avr/include/util/delay.h **** \note As an alternative method, it is possible to pass the
47:E:/WinAVR/avr/include/util/delay.h **** F_CPU macro down to the compiler from the Makefile.
48:E:/WinAVR/avr/include/util/delay.h **** Obviously, in that case, no \c \#define statement should be
49:E:/WinAVR/avr/include/util/delay.h **** used.
50:E:/WinAVR/avr/include/util/delay.h ****
51:E:/WinAVR/avr/include/util/delay.h **** The functions in this header file implement simple delay loops
52:E:/WinAVR/avr/include/util/delay.h **** that perform a busy-waiting. They are typically used to
53:E:/WinAVR/avr/include/util/delay.h **** facilitate short delays in the program execution. They are
54:E:/WinAVR/avr/include/util/delay.h **** implemented as count-down loops with a well-known CPU cycle
55:E:/WinAVR/avr/include/util/delay.h **** count per loop iteration. As such, no other processing can
56:E:/WinAVR/avr/include/util/delay.h **** occur simultaneously. It should be kept in mind that the
57:E:/WinAVR/avr/include/util/delay.h **** functions described here do not disable interrupts.
58:E:/WinAVR/avr/include/util/delay.h ****
59:E:/WinAVR/avr/include/util/delay.h **** In general, for long delays, the use of hardware timers is
60:E:/WinAVR/avr/include/util/delay.h **** much preferrable, as they free the CPU, and allow for
61:E:/WinAVR/avr/include/util/delay.h **** concurrent processing of other events while the timer is
62:E:/WinAVR/avr/include/util/delay.h **** running. However, in particular for very short delays, the
63:E:/WinAVR/avr/include/util/delay.h **** overhead of setting up a hardware timer is too much compared
64:E:/WinAVR/avr/include/util/delay.h **** to the overall delay time.
65:E:/WinAVR/avr/include/util/delay.h ****
66:E:/WinAVR/avr/include/util/delay.h **** Two inline functions are provided for the actual delay algorithms.
67:E:/WinAVR/avr/include/util/delay.h ****
68:E:/WinAVR/avr/include/util/delay.h **** Two wrapper functions allow the specification of microsecond, and
69:E:/WinAVR/avr/include/util/delay.h **** millisecond delays directly, using the application-supplied macro
70:E:/WinAVR/avr/include/util/delay.h **** F_CPU as the CPU clock frequency (in Hertz). These functions
71:E:/WinAVR/avr/include/util/delay.h **** operate on double typed arguments, however when optimization is
72:E:/WinAVR/avr/include/util/delay.h **** turned on, the entire floating-point calculation will be done at
73:E:/WinAVR/avr/include/util/delay.h **** compile-time.
74:E:/WinAVR/avr/include/util/delay.h ****
75:E:/WinAVR/avr/include/util/delay.h **** \note When using _delay_us() and _delay_ms(), the expressions
76:E:/WinAVR/avr/include/util/delay.h **** passed as arguments to these functions shall be compile-time
77:E:/WinAVR/avr/include/util/delay.h **** constants, otherwise the floating-point calculations to setup the
78:E:/WinAVR/avr/include/util/delay.h **** loops will be done at run-time, thereby drastically increasing
79:E:/WinAVR/avr/include/util/delay.h **** both the resulting code size, as well as the time required to
80:E:/WinAVR/avr/include/util/delay.h **** setup the loops.
81:E:/WinAVR/avr/include/util/delay.h **** */
82:E:/WinAVR/avr/include/util/delay.h ****
83:E:/WinAVR/avr/include/util/delay.h **** #if !defined(__DOXYGEN__)
84:E:/WinAVR/avr/include/util/delay.h **** static inline void _delay_loop_1(uint8_t __count) __attribute__((always_inline));
85:E:/WinAVR/avr/include/util/delay.h **** static inline void _delay_loop_2(uint16_t __count) __attribute__((always_inline));
86:E:/WinAVR/avr/include/util/delay.h **** static inline void _delay_us(double __us) __attribute__((always_inline));
87:E:/WinAVR/avr/include/util/delay.h **** static inline void _delay_ms(double __ms) __attribute__((always_inline));
88:E:/WinAVR/avr/include/util/delay.h **** #endif
89:E:/WinAVR/avr/include/util/delay.h ****
90:E:/WinAVR/avr/include/util/delay.h **** /** \ingroup util_delay
91:E:/WinAVR/avr/include/util/delay.h ****
92:E:/WinAVR/avr/include/util/delay.h **** Delay loop using an 8-bit counter \c __count, so up to 256
93:E:/WinAVR/avr/include/util/delay.h **** iterations are possible. (The value 256 would have to be passed
94:E:/WinAVR/avr/include/util/delay.h **** as 0.) The loop executes three CPU cycles per iteration, not
95:E:/WinAVR/avr/include/util/delay.h **** including the overhead the compiler needs to setup the counter
96:E:/WinAVR/avr/include/util/delay.h **** register.
97:E:/WinAVR/avr/include/util/delay.h ****
98:E:/WinAVR/avr/include/util/delay.h **** Thus, at a CPU speed of 1 MHz, delays of up to 768 microseconds
99:E:/WinAVR/avr/include/util/delay.h **** can be achieved.
100:E:/WinAVR/avr/include/util/delay.h **** */
101:E:/WinAVR/avr/include/util/delay.h **** void
102:E:/WinAVR/avr/include/util/delay.h **** _delay_loop_1(uint8_t __count)
103:E:/WinAVR/avr/include/util/delay.h **** {
104:E:/WinAVR/avr/include/util/delay.h **** __asm__ volatile (
105:E:/WinAVR/avr/include/util/delay.h **** "1: dec %0" "\n\t"
106:E:/WinAVR/avr/include/util/delay.h **** "brne 1b"
107:E:/WinAVR/avr/include/util/delay.h **** : "=r" (__count)
108:E:/WinAVR/avr/include/util/delay.h **** : "0" (__count)
109:E:/WinAVR/avr/include/util/delay.h **** );
110:E:/WinAVR/avr/include/util/delay.h **** }
111:E:/WinAVR/avr/include/util/delay.h ****
112:E:/WinAVR/avr/include/util/delay.h **** /** \ingroup util_delay
113:E:/WinAVR/avr/include/util/delay.h ****
114:E:/WinAVR/avr/include/util/delay.h **** Delay loop using a 16-bit counter \c __count, so up to 65536
115:E:/WinAVR/avr/include/util/delay.h **** iterations are possible. (The value 65536 would have to be
116:E:/WinAVR/avr/include/util/delay.h **** passed as 0.) The loop executes four CPU cycles per iteration,
117:E:/WinAVR/avr/include/util/delay.h **** not including the overhead the compiler requires to setup the
118:E:/WinAVR/avr/include/util/delay.h **** counter register pair.
119:E:/WinAVR/avr/include/util/delay.h ****
120:E:/WinAVR/avr/include/util/delay.h **** Thus, at a CPU speed of 1 MHz, delays of up to about 262.1
121:E:/WinAVR/avr/include/util/delay.h **** milliseconds can be achieved.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -