📄 dbgu.lst
字号:
\ 00000034 800F11E3 TST R1,#0x200
\ 00000038 FAFFFF0A BEQ ??DBGU_PutChar_1
87 }
\ 0000003C 1EFF2FE1 BX LR ;; return
88
89 //------------------------------------------------------------------------------
90 /// Reads and returns a character from the DBGU.
91 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
92 unsigned char DBGU_GetChar()
93 {
94 while ((AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_RXRDY) == 0);
\ DBGU_GetChar:
\ ??DBGU_GetChar_0:
\ 00000000 EB00E0E3 MVN R0,#+235
\ 00000004 D00EC0E3 BIC R0,R0,#0xD00
\ 00000008 000090E5 LDR R0,[R0, #+0]
\ 0000000C 010010E3 TST R0,#0x1
\ 00000010 FAFFFF0A BEQ ??DBGU_GetChar_0
95 return AT91C_BASE_DBGU->DBGU_RHR;
\ 00000014 E700E0E3 MVN R0,#+231
\ 00000018 D00EC0E3 BIC R0,R0,#0xD00
\ 0000001C 000090E5 LDR R0,[R0, #+0]
\ 00000020 FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 00000024 1EFF2FE1 BX LR ;; return
96 }
97
98 #ifndef NOFPUT
99
100 #include <stdio.h>
101
102 //------------------------------------------------------------------------------
103 /// Implementation of fputc using the DBGU as the standard output. Required
104 /// for printf().
105 /// Returns the character written if successful, or -1 if the output stream is
106 /// not stdout or stderr.
107 /// \param c Character to write.
108 /// \param pStream Output stream.
109 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
110 signed int fputc(signed int c, FILE *pStream)
111 {
\ fputc:
\ 00000000 31402DE9 PUSH {R0,R4,R5,LR}
\ 00000004 0040B0E1 MOVS R4,R0
\ 00000008 0150B0E1 MOVS R5,R1
112 if ((pStream == stdout) || (pStream == stderr)) {
\ 0000000C ........ LDR R0,??DataTable1 ;; __iar_Stdout
\ 00000010 000055E1 CMP R5,R0
\ 00000014 0200000A BEQ ??fputc_0
\ 00000018 24009FE5 LDR R0,??fputc_1 ;; __iar_Stderr
\ 0000001C 000055E1 CMP R5,R0
\ 00000020 0400001A BNE ??fputc_2
113
114 DBGU_PutChar(c);
\ ??fputc_0:
\ 00000024 0400B0E1 MOVS R0,R4
\ 00000028 FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 0000002C ........ BL DBGU_PutChar
115 return c;
\ 00000030 0400B0E1 MOVS R0,R4
\ 00000034 000000EA B ??fputc_3
116 }
117 else {
118
119 return EOF;
\ ??fputc_2:
\ 00000038 0000E0E3 MVN R0,#+0
\ ??fputc_3:
\ 0000003C 3840BDE8 POP {R3-R5,LR}
\ 00000040 1EFF2FE1 BX LR ;; return
\ ??fputc_1:
\ 00000044 ........ DC32 __iar_Stderr
120 }
121 }
122
123 //------------------------------------------------------------------------------
124 /// Implementation of fputs using the DBGU as the standard output. Required
125 /// for printf(). Does NOT currently use the PDC.
126 /// Returns the number of characters written if successful, or -1 if the output
127 /// stream is not stdout or stderr.
128 /// \param pStr String to write.
129 /// \param pStream Output stream.
130 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
131 signed int fputs(const char *pStr, FILE *pStream)
132 {
\ fputs:
\ 00000000 70402DE9 PUSH {R4-R6,LR}
\ 00000004 0040B0E1 MOVS R4,R0
\ 00000008 0150B0E1 MOVS R5,R1
133 signed int num = 0;
\ 0000000C 0000A0E3 MOV R0,#+0
\ 00000010 0060B0E1 MOVS R6,R0
134
135 while (*pStr != 0) {
\ ??fputs_0:
\ 00000014 0000D4E5 LDRB R0,[R4, #+0]
\ 00000018 000050E3 CMP R0,#+0
\ 0000001C 0900000A BEQ ??fputs_1
136
137 if (fputc(*pStr, pStream) == -1) {
\ 00000020 0510B0E1 MOVS R1,R5
\ 00000024 0000D4E5 LDRB R0,[R4, #+0]
\ 00000028 ........ BL fputc
\ 0000002C 010070E3 CMN R0,#+1
\ 00000030 0100001A BNE ??fputs_2
138
139 return -1;
\ 00000034 0000E0E3 MVN R0,#+0
\ 00000038 030000EA B ??fputs_3
140 }
141 num++;
\ ??fputs_2:
\ 0000003C 016096E2 ADDS R6,R6,#+1
142 pStr++;
\ 00000040 014094E2 ADDS R4,R4,#+1
\ 00000044 F2FFFFEA B ??fputs_0
143 }
144
145 return num;
\ ??fputs_1:
\ 00000048 0600B0E1 MOVS R0,R6
\ ??fputs_3:
\ 0000004C 7040BDE8 POP {R4-R6,LR}
\ 00000050 1EFF2FE1 BX LR ;; return
146 }
147
148 #undef putchar
149
150 //------------------------------------------------------------------------------
151 /// Outputs a character on the DBGU. Returns the character itself.
152 /// \param c Character to output.
153 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
154 signed int putchar(signed int c)
155 {
\ putchar:
\ 00000000 10402DE9 PUSH {R4,LR}
\ 00000004 0040B0E1 MOVS R4,R0
156 return fputc(c, stdout);
\ 00000008 ........ LDR R1,??DataTable1 ;; __iar_Stdout
\ 0000000C 0400B0E1 MOVS R0,R4
\ 00000010 ........ BL fputc
\ 00000014 1040BDE8 POP {R4,LR}
\ 00000018 1EFF2FE1 BX LR ;; return
157 }
\ In section .text, align 4, keep-with-next
\ ??DataTable1:
\ 00000000 ........ DC32 __iar_Stdout
158
159 #endif //#ifndef NOFPUT
160
Maximum stack usage in bytes:
Function .cstack
-------- -------
DBGU_Configure 16
DBGU_GetChar 0
DBGU_PutChar 0
fputc 16
fputs 16
putchar 8
Section sizes:
Function/Label Bytes
-------------- -----
DBGU_Configure 132
??DBGU_PutChar_0 64
??DBGU_GetChar_0 40
fputc 72
fputs 84
putchar 28
??DataTable1 4
424 bytes in section .text
424 bytes of CODE memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -