uart0demo.lst
来自「飞利浦公司lpc2148串口测试源代码 飞利浦公司lpc2148串口测试源代码」· LST 代码 · 共 183 行
LST
183 行
ARM COMPILER V2.42, Uart0Demo 06/01/06 13:42:38 PAGE 1
ARM COMPILER V2.42, COMPILATION OF MODULE Uart0Demo
OBJECT MODULE PLACED IN .\Obj\Uart0Demo.obj
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe Uart0Demo.c THUMB BROWSE DEBUG PRINT(.\LST\UART0DEMO.LST) TABS(4) OBJECT(.\O
-bj\Uart0Demo.obj)
stmt level source
1 /*============================================================
2 LPC214X 串口功能演示
3 作者: Mingtree ycxms88@163.com http://www.mcu123.com
4 ==============================================================
5
6 本例程的CCLK=60M.
7 晶振采用12M
8 倍频系数为:5
9 分频系数为:2
10 以上设置在Startup.s中设置
11 */
12
13 #include <LPC214X.H>
14 #include <Uart0.H>
15 #include <Config.H>
16
17
18 #define UART_BAUD(baud) (unsigned int)((FOSC*PLL_M) / (baud * 16))
19
20
21
22
23 void Init_Uart0(unsigned int Baud)
24 {
25 1 /* initialize the serial interface */
26 1 PINSEL0 = 0x00000005; /* Enable RxD0 and TxD0 */
27 1 U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */
28 1 U0DLM=(unsigned char)(Baud>>8);
29 1 U0DLL = (unsigned char)Baud;
30 1
31 1 U0LCR = 0x03; /* DLAB = 0 */
32 1 }
33
34 void delay (unsigned int i) { /* Delay function */
35 1 unsigned int n;
36 1 while(i>1)
37 1 {
38 2 for(n=65535;n>1;n--);
39 2 i--;
40 2 }
41 1 }
42
43 void main(void)
44 {
45 1 Init_Uart0(UART_BAUD(115200));
46 1
47 1 while(1)
48 1 {
49 2 Sent_Str("www.mcu123.com \n") ;
50 2 delay(200);
51 2 }
52 1 }
ARM COMPILER V2.42, Uart0Demo 06/01/06 13:42:38 PAGE 2
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** EXTERNALS:
EXTERN CODE16 (Sent_Str?T)
EXTERN NUMBER (__startup)
*** PUBLICS:
PUBLIC Init_Uart0?T
PUBLIC delay?T
PUBLIC main
*** DATA SEGMENT '?CON?Uart0Demo':
00000000 ??S_1:
00000000 DB 'www.mcu123.com ',0x0A,0x00
*** CODE SEGMENT '?PR?Init_Uart0?T?Uart0Demo':
23: void Init_Uart0(unsigned int Baud)
00000000 ---- Variable 'Baud' assigned to Register 'R0' ----
26: PINSEL0 = 0x00000005; /* Enable RxD0 and TxD0 */
00000000 2205 MOV R2,#0x5
00000002 4800 LDR R1,=0xE002C000
00000004 600A STR R2,[R1,#0x0]
27: U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */
00000006 2283 MOV R2,#0x83
00000008 4800 LDR R1,=0xE000C00C
0000000A 700A STRB R2,[R1,#0x0]
28: U0DLM=(unsigned char)(Baud>>8);
0000000C 1C02 MOV R2,R0 ; Baud
0000000E 0A12 LSR R2,R2,#0x8 ; Baud
00000010 0612 LSL R2,R2,#0x18
00000012 0E12 LSR R2,R2,#0x18
00000014 4800 LDR R1,=0xE000C004
00000016 700A STRB R2,[R1,#0x0]
29: U0DLL = (unsigned char)Baud;
00000018 1C01 MOV R1,R0 ; Baud
0000001A 0609 LSL R1,R1,#0x18 ; Baud
0000001C 0E09 LSR R1,R1,#0x18
0000001E 4800 LDR R0,=0xE000C000
00000020 7001 STRB R1,[R0,#0x0]
31: U0LCR = 0x03; /* DLAB = 0 */
00000022 2103 MOV R1,#0x3
00000024 4800 LDR R0,=0xE000C00C
00000026 7001 STRB R1,[R0,#0x0]
32: }
00000028 4770 BX R14
0000002A ENDP ; 'Init_Uart0?T'
*** CODE SEGMENT '?PR?delay?T?Uart0Demo':
34: void delay (unsigned int i) { /* Delay function */
00000000 ---- Variable 'i' assigned to Register 'R0' ----
00000000 ; SCOPE-START
36: while(i>1)
00000000 E005 B L_1 ; T=0x0000000E
38: for(n=65535;n>1;n--);
00000002 L_9:
00000002 4800 LDR R1,=0xFFFF
00000004 ---- Variable 'n' assigned to Register 'R1' ----
00000004 L_5:
00000004 3901 SUB R1,#0x1
00000006 1C0A MOV R2,R1 ; n
00000008 2A01 CMP R2,#0x1 ; n
0000000A D8FB BHI L_5 ; T=0x00000004
39: i--;
0000000C 3801 SUB R0,#0x1
40: }
0000000E L_1:
0000000E 1C01 MOV R1,R0 ; i
ARM COMPILER V2.42, Uart0Demo 06/01/06 13:42:38 PAGE 3
00000010 2901 CMP R1,#0x1 ; i
00000012 D8F6 BHI L_9 ; T=0x00000002
00000014 ; SCOPE-END
41: }
00000014 4770 BX R14
00000016 ENDP ; 'delay?T'
*** CODE SEGMENT '?PR?main?Uart0Demo':
43: void main(void)
00000000 B500 PUSH {LR}
45: Init_Uart0(UART_BAUD(115200));
00000002 2020 MOV R0,#0x20
00000004 F7FF BL Init_Uart0?T ; T=0x0001 (1)
00000006 FFFC BL Init_Uart0?T ; T=0x0001 (2)
47: while(1)
00000008 L_12:
49: Sent_Str("www.mcu123.com \n") ;
00000008 4800 LDR R0,=??S_1 ; ??S_1
0000000A F7FF BL Sent_Str?T ; T=0x0001 (1)
0000000C FFF9 BL Sent_Str?T ; T=0x0001 (2)
50: delay(200);
0000000E 20C8 MOV R0,#0xC8
00000010 F7FF BL delay?T ; T=0x0001 (1)
00000012 FFF6 BL delay?T ; T=0x0001 (2)
51: }
00000014 E7F8 B L_12 ; T=0x00000008
00000016 BC08 POP {R3}
00000018 4718 BX R3
0000001A ENDP ; 'main'
Module Information Static
----------------------------------
code size = ------
data size = ------
const size = 17
End of Module Information.
ARM COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?