📄 uartdebug.lst
字号:
1 .file "uartDebug.c"
2 .arch atmega128
3 __SREG__ = 0x3f
4 __SP_H__ = 0x3e
5 __SP_L__ = 0x3d
6 __tmp_reg__ = 0
7 __zero_reg__ = 1
8 .global __do_copy_data
9 .global __do_clear_bss
11 .text
12 .Ltext0:
62 .global uartDebug_init
64 uartDebug_init:
1:uartDebug.c ****
2:uartDebug.c ****
3:uartDebug.c **** #include "uartDebug.h"
4:uartDebug.c **** #include "type.h"
5:uartDebug.c ****
6:uartDebug.c **** #define DBG_BUF_LEN 40
7:uartDebug.c **** #define ADVANCE(x) x = (((x+1) >= DBG_BUF_LEN) ? 0 : x+1) // from TXMAN.c
8:uartDebug.c **** #define UART_IDLE 0
9:uartDebug.c **** #define UART_BUSY 1
10:uartDebug.c ****
11:uartDebug.c **** char UARTState;
12:uartDebug.c **** char dbgBuf[DBG_BUF_LEN];
13:uartDebug.c **** uint8_t dbgHead;
14:uartDebug.c **** uint8_t dbgTail;
15:uartDebug.c **** uint8_t dbgBufCount;
16:uartDebug.c ****
17:uartDebug.c **** void uartDebug_init()
18:uartDebug.c **** {
66 .LM1:
67 /* prologue: frame size=0 */
68 /* prologue end (size=0) */
19:uartDebug.c **** UARTState = UART_IDLE;
70 .LM2:
71 0000 1092 0000 sts UARTState,__zero_reg__
20:uartDebug.c **** dbgBufCount = 0;
73 .LM3:
74 0004 1092 0000 sts dbgBufCount,__zero_reg__
21:uartDebug.c **** dbgHead = 0;
76 .LM4:
77 0008 1092 0000 sts dbgHead,__zero_reg__
22:uartDebug.c **** dbgTail = 0;
79 .LM5:
80 000c 1092 0000 sts dbgTail,__zero_reg__
23:uartDebug.c **** // initialize UART
24:uartDebug.c **** * (volatile unsigned char *)0x90 = 0; /* UBRR0H = 0 */
82 .LM6:
83 0010 1092 9000 sts 144,__zero_reg__
25:uartDebug.c **** * (volatile unsigned char *)(0x09 + 0x20) = 15; /* UBRR0L = 15 */
85 .LM7:
86 0014 8FE0 ldi r24,lo8(15)
87 0016 89B9 out 41-0x20,r24
26:uartDebug.c **** /* UCSR0A中的U2X0 = 1,即传输速率倍速 */
27:uartDebug.c **** * (volatile unsigned char *)(0x0B + 0x20) = 1 << 1;
89 .LM8:
90 0018 82E0 ldi r24,lo8(2)
91 001a 8BB9 out 43-0x20,r24
28:uartDebug.c **** /* UCSR0C中UCSZ1 = 1,UCSZ0 = 1,即传送或接收字符长为8bit */
29:uartDebug.c **** * (volatile unsigned char *)0x95 = (1 << 2) | (1 << 1);
93 .LM9:
94 001c 86E0 ldi r24,lo8(6)
95 001e 8093 9500 sts 149,r24
30:uartDebug.c **** /* UCSR0B中的RXCIE,TXCIE,RXEN和TXEN都置为1 */
31:uartDebug.c **** * (volatile unsigned char *)(0x0A + 0x20) = (((1 << 7) | (1 << 6)) | (1 << 4)) | (1 << 3);
97 .LM10:
98 0022 88ED ldi r24,lo8(-40)
99 0024 8AB9 out 42-0x20,r24
100 /* epilogue: frame size=0 */
101 0026 0895 ret
102 /* epilogue end (size=1) */
103 /* function uartDebug_init size 20 (19) */
107 .global uartDebug_txByte
109 uartDebug_txByte:
32:uartDebug.c **** }
33:uartDebug.c ****
34:uartDebug.c **** void uartDebug_txByte(char byte)
35:uartDebug.c **** {
111 .LM11:
112 /* prologue: frame size=0 */
113 /* prologue end (size=0) */
114 0028 482F mov r20,r24
36:uartDebug.c **** if (UARTState == UART_IDLE) { // send byte if UART is idle
116 .LM12:
117 002a 8091 0000 lds r24,UARTState
118 002e 8823 tst r24
119 0030 31F4 brne .L3
37:uartDebug.c **** UARTState = UART_BUSY;
121 .LM13:
122 0032 81E0 ldi r24,lo8(1)
123 0034 8093 0000 sts UARTState,r24
38:uartDebug.c **** * (volatile unsigned char *)(0x0C + 0x20) = byte; /* 将data写入数据寄存器UDR0 */
125 .LM14:
126 0038 4CB9 out 44-0x20,r20
39:uartDebug.c **** * (volatile unsigned char *)(0x0B + 0x20) |= 1 << 6; /* 向TXC位写逻辑1,从而清零该位 */
128 .LM15:
129 003a 5E9A sbi 43-0x20,6
130 003c 0895 ret
131 .L3:
40:uartDebug.c **** }
41:uartDebug.c **** else
42:uartDebug.c **** {
43:uartDebug.c **** if (dbgBufCount < DBG_BUF_LEN) {
133 .LM16:
134 003e 2091 0000 lds r18,dbgBufCount
135 0042 2832 cpi r18,lo8(40)
136 0044 A0F4 brsh .L2
44:uartDebug.c **** dbgBuf[dbgTail] = byte;
138 .LM17:
139 0046 3091 0000 lds r19,dbgTail
140 004a 832F mov r24,r19
141 004c 9927 clr r25
142 004e FC01 movw r30,r24
143 0050 E050 subi r30,lo8(-(dbgBuf))
144 0052 F040 sbci r31,hi8(-(dbgBuf))
145 0054 4083 st Z,r20
45:uartDebug.c **** ADVANCE(dbgTail);
147 .LM18:
148 0056 0196 adiw r24,1
149 0058 8897 sbiw r24,40
150 005a 1CF4 brge .L6
151 005c 832F mov r24,r19
152 005e 8F5F subi r24,lo8(-(1))
153 0060 01C0 rjmp .L7
154 .L6:
155 0062 80E0 ldi r24,lo8(0)
156 .L7:
157 0064 8093 0000 sts dbgTail,r24
46:uartDebug.c **** dbgBufCount++;
159 .LM19:
160 0068 2F5F subi r18,lo8(-(1))
161 006a 2093 0000 sts dbgBufCount,r18
162 .L2:
163 006e 0895 ret
164 /* epilogue: frame size=0 */
165 0070 0895 ret
166 /* epilogue end (size=1) */
167 /* function uartDebug_txByte size 38 (37) */
170 .global __vector_20
172 __vector_20:
47:uartDebug.c **** }
48:uartDebug.c **** }
49:uartDebug.c **** }
50:uartDebug.c ****
51:uartDebug.c **** /***************************************************************************
52:uartDebug.c **** __vector_20(void)
53:uartDebug.c **** *功能描述:UART发送完成中断
54:uartDebug.c **** *参数说明:无
55:uartDebug.c **** *返回值: 无
56:uartDebug.c **** **************************************************************************/
57:uartDebug.c ****
58:uartDebug.c **** void __attribute((interrupt)) __vector_20(void)
59:uartDebug.c **** {
174 .LM20:
175 /* prologue: frame size=0 */
176 0072 7894 sei
177 0074 1F92 push __zero_reg__
178 0076 0F92 push __tmp_reg__
179 0078 0FB6 in __tmp_reg__,__SREG__
180 007a 0F92 push __tmp_reg__
181 007c 1124 clr __zero_reg__
182 007e 2F93 push r18
183 0080 3F93 push r19
184 0082 8F93 push r24
185 0084 9F93 push r25
186 0086 EF93 push r30
187 0088 FF93 push r31
188 /* prologue end (size=12) */
60:uartDebug.c **** char byte;
61:uartDebug.c **** if(dbgBufCount > 0) {
190 .LM21:
191 008a 2091 0000 lds r18,dbgBufCount
192 008e 2223 tst r18
193 0090 B9F0 breq .L9
62:uartDebug.c **** byte = dbgBuf[dbgHead];
195 .LM22:
196 0092 3091 0000 lds r19,dbgHead
197 0096 832F mov r24,r19
198 0098 9927 clr r25
199 009a FC01 movw r30,r24
200 009c E050 subi r30,lo8(-(dbgBuf))
201 009e F040 sbci r31,hi8(-(dbgBuf))
202 00a0 E081 ld r30,Z
63:uartDebug.c **** ADVANCE(dbgHead);
204 .LM23:
205 00a2 0196 adiw r24,1
206 00a4 8897 sbiw r24,40
207 00a6 1CF4 brge .L10
208 00a8 832F mov r24,r19
209 00aa 8F5F subi r24,lo8(-(1))
210 00ac 01C0 rjmp .L11
211 .L10:
212 00ae 80E0 ldi r24,lo8(0)
213 .L11:
214 00b0 8093 0000 sts dbgHead,r24
64:uartDebug.c **** dbgBufCount--;
216 .LM24:
217 00b4 2150 subi r18,lo8(-(-1))
218 00b6 2093 0000 sts dbgBufCount,r18
65:uartDebug.c **** * (volatile unsigned char *)(0x0C + 0x20) = byte; /* 将data写入数据寄存器UDR0 */
220 .LM25:
221 00ba ECB9 out 44-0x20,r30
66:uartDebug.c **** * (volatile unsigned char *)(0x0B + 0x20) |= 1 << 6; /* 向TXC位写逻辑1,从而清零该位 */
223 .LM26:
224 00bc 5E9A sbi 43-0x20,6
225 00be 02C0 rjmp .L8
226 .L9:
67:uartDebug.c **** } else {
68:uartDebug.c **** UARTState = UART_IDLE;
228 .LM27:
229 00c0 2093 0000 sts UARTState,r18
230 .L8:
231 /* epilogue: frame size=0 */
232 00c4 FF91 pop r31
233 00c6 EF91 pop r30
234 00c8 9F91 pop r25
235 00ca 8F91 pop r24
236 00cc 3F91 pop r19
237 00ce 2F91 pop r18
238 00d0 0F90 pop __tmp_reg__
239 00d2 0FBE out __SREG__,__tmp_reg__
240 00d4 0F90 pop __tmp_reg__
241 00d6 1F90 pop __zero_reg__
242 00d8 1895 reti
243 /* epilogue end (size=11) */
244 /* function __vector_20 size 53 (30) */
248 .global __vector_18
250 __vector_18:
69:uartDebug.c **** }
70:uartDebug.c ****
71:uartDebug.c **** }
72:uartDebug.c ****
73:uartDebug.c **** /***************************************************************************
74:uartDebug.c **** __vector_18(void)
75:uartDebug.c ****
76:uartDebug.c **** *功能描述:UART接收完成中断
77:uartDebug.c **** *参数说明:无
78:uartDebug.c **** *返回值: 无
79:uartDebug.c **** **************************************************************************/
80:uartDebug.c ****
81:uartDebug.c **** void __attribute((signal)) __vector_18(void)
82:uartDebug.c **** {
252 .LM28:
253 /* prologue: frame size=0 */
254 00da 1F92 push __zero_reg__
255 00dc 0F92 push __tmp_reg__
256 00de 0FB6 in __tmp_reg__,__SREG__
257 00e0 0F92 push __tmp_reg__
258 00e2 1124 clr __zero_reg__
259 /* prologue end (size=5) */
260 /* epilogue: frame size=0 */
261 00e4 0F90 pop __tmp_reg__
262 00e6 0FBE out __SREG__,__tmp_reg__
263 00e8 0F90 pop __tmp_reg__
264 00ea 1F90 pop __zero_reg__
265 00ec 1895 reti
266 /* epilogue end (size=5) */
267 /* function __vector_18 size 10 (0) */
269 .comm UARTState,1,1
270 .comm dbgBuf,40,1
271 .comm dbgHead,1,1
272 .comm dbgTail,1,1
273 .comm dbgBufCount,1,1
279 .text
281 Letext:
282 /* File "uartDebug.c": code 121 = 0x0079 ( 86), prologues 17, epilogues 18 */
DEFINED SYMBOLS
*ABS*:00000000 uartDebug.c
*ABS*:0000003f __SREG__
*ABS*:0000003e __SP_H__
*ABS*:0000003d __SP_L__
*ABS*:00000000 __tmp_reg__
*ABS*:00000001 __zero_reg__
C:\DOCUME~1\xiapeng\LOCALS~1\Temp/ccMFbaaa.s:64 .text:00000000 uartDebug_init
*COM*:00000001 UARTState
*COM*:00000001 dbgBufCount
*COM*:00000001 dbgHead
*COM*:00000001 dbgTail
C:\DOCUME~1\xiapeng\LOCALS~1\Temp/ccMFbaaa.s:109 .text:00000028 uartDebug_txByte
*COM*:00000028 dbgBuf
C:\DOCUME~1\xiapeng\LOCALS~1\Temp/ccMFbaaa.s:172 .text:00000072 __vector_20
C:\DOCUME~1\xiapeng\LOCALS~1\Temp/ccMFbaaa.s:250 .text:000000da __vector_18
C:\DOCUME~1\xiapeng\LOCALS~1\Temp/ccMFbaaa.s:281 .text:000000ee Letext
UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -