📄 serial.lst
字号:
ARM COMPILER V2.53, Serial 22/04/07 09:58:00 PAGE 1
ARM COMPILER V2.53, COMPILATION OF MODULE Serial
OBJECT MODULE PLACED IN .\Obj\Serial.obj
COMPILER INVOKED BY: c:\Keil\ARM\BIN\CA.exe Serial.c THUMB OPTIMIZE(7,SPEED) DEBUG PRINT(.\LST\SERIAL.LST) TABS(4) OBJEC
-T(.\Obj\Serial.obj)
stmt level source
1 /******************************************************************************/
2 /* This file is part of the uVision/ARM development tools */
3 /* Copyright KEIL ELEKTRONIK GmbH 2002-2004 */
4 /******************************************************************************/
5 /* */
6 /* SERIAL.C: Low Level Serial Routines */
7 /* */
8 /******************************************************************************/
9
10 #include <LPC21xx.H> /* LPC21xx definitions */
11
12 #define CR 0x0D
13
14
15 int putchar (int ch) { /* Write character to Serial Port */
16 1
17 1 if (ch == '\n') {
18 2 while (!(U1LSR & 0x20));
19 2 U1THR = CR; /* output CR */
20 2 }
21 1 while (!(U1LSR & 0x20));
22 1 return (U1THR = ch);
23 1 }
24
25
26 int getchar (void) { /* Read character from Serial Port */
27 1
28 1 while (!(U1LSR & 0x01));
29 1
30 1 return (U1RBR);
31 1 }
ARM COMPILER V2.53, Serial 22/04/07 09:58:00 PAGE 2
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** PUBLICS:
PUBLIC putchar?T
PUBLIC getchar?T
*** CODE SEGMENT '?PR?putchar?T?Serial':
15: int putchar (int ch) { /* Write character to Serial Port */
00000000 1C01 MOV R1,R0 ; ch
00000002 ---- Variable 'ch' assigned to Register 'R1' ----
17: if (ch == '\n') {
00000002 1C08 MOV R0,R1 ; ch
00000004 280A CMP R0,#0xA ; ch
00000006 D107 BNE L_9 ; T=0x00000018
18: while (!(U1LSR & 0x20));
00000008 L_2:
00000008 4800 LDR R0,=0xE0010014
0000000A 7800 LDRB R0,[R0,#0x0]
0000000C 2220 MOV R2,#0x20
0000000E 4210 TST R0,R2
00000010 D0FA BEQ L_2 ; T=0x00000008
19: U1THR = CR; /* output CR */
00000012 220D MOV R2,#0xD
00000014 4800 LDR R0,=0xE0010000
00000016 7002 STRB R2,[R0,#0x0]
21: while (!(U1LSR & 0x20));
00000018 L_9:
00000018 L_6:
00000018 4800 LDR R0,=0xE0010014
0000001A 7800 LDRB R0,[R0,#0x0]
0000001C 2220 MOV R2,#0x20
0000001E 4210 TST R0,R2
00000020 D0FA BEQ L_6 ; T=0x00000018
22: return (U1THR = ch);
00000022 1C08 MOV R0,R1 ; ch
00000024 0600 LSL R0,R0,#0x18 ; ch
00000026 0E00 LSR R0,R0,#0x18
00000028 4800 LDR R1,=0xE0010000
0000002A 7008 STRB R0,[R1,#0x0]
0000002C 0600 LSL R0,R0,#0x18
0000002E 0E00 LSR R0,R0,#0x18
23: }
00000030 4770 BX R14
00000032 ENDP ; 'putchar?T'
*** CODE SEGMENT '?PR?getchar?T?Serial':
28: while (!(U1LSR & 0x01));
00000000 L_11:
00000000 4800 LDR R0,=0xE0010014
00000002 7800 LDRB R0,[R0,#0x0]
00000004 2101 MOV R1,#0x1
00000006 4208 TST R0,R1
00000008 D0FA BEQ L_11 ; T=0x00000000
30: return (U1RBR);
0000000A 4800 LDR R0,=0xE0010000
0000000C 7800 LDRB R0,[R0,#0x0]
31: }
0000000E 4770 BX R14
00000010 ENDP ; 'getchar?T'
Module Information Static
----------------------------------
code size = ------
data size = ------
const size = ------
End of Module Information.
ARM COMPILER V2.53, Serial 22/04/07 09:58:00 PAGE 3
ARM COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -