?? serial.lst
字號:
ARM COMPILER V2.00f, serial 19/02/05 10:02:20 PAGE 1
ARM COMPILER V2.00f, COMPILATION OF MODULE serial
OBJECT MODULE PLACED IN serial.OBJ
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe serial.c THUMB OPTIMIZE(7,SPEED) BROWSE DEBUG TABS(4)
stmt level source
1 /************************************************************/
2 /* PROJECT NAME: Standard IO */
3 /* Project: LPC2100 Training course */
4 /* Engineer: T Martin tmartin@hitex.co.uk */
5 /* Filename: serial.c */
6 /* Language: C */
7 /* Compiler: Keil ARM V2.00b */
8 /* Assembler: */
9 /* */
10 /************************************************************/
11 /* COPYRIGHT: Hitex UK Ltd 2005 */
12 /* LICENSE: THIS VERSION CREATED FOR FREE DISTRIBUTION */
13 /************************************************************/
14 /* Function: */
15 /* */
16 /* Example Standard I/O program for LPC2100 */
17 /* */
18 /* Demonstrates interfacing STDIO library function */
19 /* to low level drivers */
20 /* */
21 /* Oscillator frequency 12.000 Mhz */
22 /* Target board Keil MCB2100 */
23 /************************************************************/
24
25 #define CR 0x0D
26
27 #include <LPC21xx.H>
28 int putchar (int ch);
29
30 int putchar (int ch)
31 { /* Write character to Serial Port */
32 1
33 1 if (ch == '\n')
34 1 {
35 2 while (!(U0LSR & 0x20));
36 2 U0THR = CR; /* output CR */
37 2 }
38 1 while (!(U0LSR & 0x20));
39 1
40 1
41 1 return (U0THR = ch);
42 1 }
43
44
ARM COMPILER V2.00f, serial 19/02/05 10:02:20 PAGE 2
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** PUBLICS:
PUBLIC putchar?T
*** CODE SEGMENT '?PR?putchar?T?serial':
30: int putchar (int ch)
00000000 ---- Variable 'ch' assigned to Register 'R0' ----
33: if (ch == '\n')
00000000 280A CMP R0,#0xA ; ch
00000002 D107 BNE L_9 ; T=0x00000014
35: while (!(U0LSR & 0x20));
00000004 L_2:
00000004 4800 LDR R1,=0xE000C014
00000006 7809 LDRB R1,[R1,#0x0]
00000008 2220 MOV R2,#0x20
0000000A 4211 TST R1,R2
0000000C D0FA BEQ L_2 ; T=0x00000004
36: U0THR = CR; /* output CR */
0000000E 220D MOV R2,#0xD
00000010 4800 LDR R1,=0xE000C000
00000012 700A STRB R2,[R1,#0x0]
38: while (!(U0LSR & 0x20));
00000014 L_9:
00000014 L_6:
00000014 4800 LDR R1,=0xE000C014
00000016 7809 LDRB R1,[R1,#0x0]
00000018 2220 MOV R2,#0x20
0000001A 4211 TST R1,R2
0000001C D0FA BEQ L_6 ; T=0x00000014
41: return (U0THR = ch);
0000001E 4800 LDR R1,=0xE000C000
00000020 7008 STRB R0,[R1,#0x0]
00000022 0600 LSL R0,R0,#0x18 ; ch
00000024 0E00 LSR R0,R0,#0x18
42: }
00000026 4770 BX R14
00000028 ENDP ; 'putchar?T'
Module Information Static
----------------------------------
code size = ------
data size = ------
const size = ------
End of Module Information.
ARM COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -