📄 uart1.txt
字号:
; generated by ARM/Thumb C/C++ Compiler with , RVCT3.1 [Build 942] for uVision
; commandline ArmCC [--debug -c --asm --interleave -ouart1.o --depend=uart1.d --device=DARMP --apcs=interwork -O3 -IC:\Keil\ARM\INC\Philips --omf_browse=uart1.crf UART1.C]
ARM
AREA ||.text||, CODE, READONLY, ALIGN=2
uart4_init PROC
000000 e1a01200 LSL r1,r0,#4
000004 e92d4010 PUSH {r4,lr}
000008 e59f01b8 LDR r0,|L1.456|
00000c ebfffffe BL __aeabi_uidivmod
000010 e3a02083 MOV r2,#0x83
000014 e3a01481 MOV r1,#0x81000000
000018 e5c1201c STRB r2,[r1,#0x1c]
00001c e5c10000 STRB r0,[r1,#0]
000020 e1a00420 LSR r0,r0,#8
000024 e5c10004 STRB r0,[r1,#4]
000028 e3a00003 MOV r0,#3
00002c e5c1001c STRB r0,[r1,#0x1c]
000030 e8bd4010 POP {r4,lr}
000034 e12fff1e BX lr
ENDP
uart4_putc PROC
000038 e3a01481 MOV r1,#0x81000000
|L1.60|
00003c e5d12014 LDRB r2,[r1,#0x14]
000040 e3120020 TST r2,#0x20
000044 0afffffc BEQ |L1.60|
000048 e5c10000 STRB r0,[r1,#0]
00004c e12fff1e BX lr
ENDP
uart4_puts PROC
000050 e1a03000 MOV r3,r0
000054 e52de004 PUSH {lr}
000058 ea000001 B |L1.100|
|L1.92|
00005c e2833001 ADD r3,r3,#1
000060 ebfffffe BL uart4_putc
|L1.100|
000064 e5d30000 LDRB r0,[r3,#0]
000068 e3500000 CMP r0,#0
00006c 1afffffa BNE |L1.92|
000070 e49de004 POP {lr}
000074 e12fff1e BX lr
ENDP
uart3_init PROC
000078 e1a01200 LSL r1,r0,#4
00007c e92d4010 PUSH {r4,lr}
000080 e59f0140 LDR r0,|L1.456|
000084 ebfffffe BL __aeabi_uidivmod
000088 e3a02083 MOV r2,#0x83
00008c e3a01481 MOV r1,#0x81000000
000090 e5c1209c STRB r2,[r1,#0x9c]
000094 e5c10080 STRB r0,[r1,#0x80]
000098 e1a00420 LSR r0,r0,#8
00009c e5c10084 STRB r0,[r1,#0x84]
0000a0 e3a00003 MOV r0,#3
0000a4 e5c1009c STRB r0,[r1,#0x9c]
0000a8 e8bd4010 POP {r4,lr}
0000ac e12fff1e BX lr
ENDP
uart3_putc PROC
0000b0 e3a01481 MOV r1,#0x81000000
|L1.180|
0000b4 e5d12094 LDRB r2,[r1,#0x94]
0000b8 e3120020 TST r2,#0x20
0000bc 0afffffc BEQ |L1.180|
0000c0 e5c10080 STRB r0,[r1,#0x80]
0000c4 e12fff1e BX lr
ENDP
uart3_puts PROC
0000c8 e1a03000 MOV r3,r0
0000cc e52de004 PUSH {lr}
0000d0 ea000001 B |L1.220|
|L1.212|
0000d4 e2833001 ADD r3,r3,#1
0000d8 ebfffffe BL uart3_putc
|L1.220|
0000dc e5d30000 LDRB r0,[r3,#0]
0000e0 e3500000 CMP r0,#0
0000e4 1afffffa BNE |L1.212|
0000e8 e49de004 POP {lr}
0000ec e12fff1e BX lr
ENDP
uart0_init PROC
;;;116 void uart0_init(unsigned int _baudrate)
;;;117 {
0000f0 e1a01200 LSL r1,r0,#4
0000f4 e92d4010 PUSH {r4,lr}
;;;118 unsigned short u0dl;
;;;119 u0dl = _PCLK/(16*_baudrate); // Calculate for U0DL value
0000f8 e59f00cc LDR r0,|L1.460|
0000fc ebfffffe BL __aeabi_uidivmod
;;;120 PINSEL0 |= 0x00000005; // Enable rx,tx
000100 e59f10c8 LDR r1,|L1.464|
000104 e5912000 LDR r2,[r1,#0]
000108 e3822005 ORR r2,r2,#5
00010c e5812000 STR r2,[r1,#0]
;;;121 U0LCR = 0x00000083; // 8 bit data,1 stop bit,no parity bit
000110 e3a02083 MOV r2,#0x83
000114 e2411802 SUB r1,r1,#0x20000
000118 e5c1200c STRB r2,[r1,#0xc]
;;;122 U0DLL = u0dl & 0xFF; // U0DL for low byte
00011c e5c10000 STRB r0,[r1,#0]
;;;123 U0DLM = (u0dl>>8); // U0DL for high byte
000120 e1a00420 LSR r0,r0,#8
000124 e5c10004 STRB r0,[r1,#4]
;;;124 U0LCR = 0x00000003; // DLAB =0
000128 e3a00003 MOV r0,#3
00012c e5c1000c STRB r0,[r1,#0xc]
;;;125 }
000130 e8bd4010 POP {r4,lr}
000134 e12fff1e BX lr
;;;126 //------------------------------------------------------------------------------------------------//
ENDP
uart0_putc PROC
000138 e59f1094 LDR r1,|L1.468|
|L1.316|
00013c e5d12014 LDRB r2,[r1,#0x14] ;0
000140 e3120020 TST r2,#0x20 ;0
000144 0afffffc BEQ |L1.316|
000148 e5c10000 STRB r0,[r1,#0] ;0
00014c e12fff1e BX lr ;0
ENDP
uart0_puts PROC
;;;137 void uart0_puts(char *p)
;;;138 {
000150 e1a03000 MOV r3,r0
000154 e52de004 PUSH {lr}
000158 ea000001 B |L1.356|
|L1.348|
;;;139 while(*p) // Point to character
;;;140 {
;;;141 uart0_putc(*p++); // Send character then point to next character
00015c e2833001 ADD r3,r3,#1
000160 ebfffffe BL uart0_putc
|L1.356|
000164 e5d30000 LDRB r0,[r3,#0] ;139
000168 e3500000 CMP r0,#0 ;139
00016c 1afffffa BNE |L1.348|
;;;142 }
;;;143 }
000170 e49de004 POP {lr}
000174 e12fff1e BX lr
;;;144 int main(void)
ENDP
main PROC
;;;145 {
;;;146 SCS = 0x03;
000178 e59f1058 LDR r1,|L1.472|
00017c e92d4010 PUSH {r4,lr} ;145
000180 e3a00003 MOV r0,#3
000184 e5c101a0 STRB r0,[r1,#0x1a0]
;;;147 PINSEL2=0x0E6149E4;
000188 e59f004c LDR r0,|L1.476|
00018c e241181d SUB r1,r1,#0x1d0000
000190 e5810014 STR r0,[r1,#0x14]
;;;148
;;;149 uart0_init(9600);
000194 e3a00d96 MOV r0,#0x2580
000198 ebfffffe BL uart0_init
;;;150 uart3_init(9600); // Initial UART3 @ 9600 bps,8 bit data ,1 stop bit ,no parity bit
00019c e3a00d96 MOV r0,#0x2580
0001a0 ebfffffe BL uart3_init
;;;151 uart4_init(9600); // Initial UART4 @ 9600 bps,8 bit data ,1 stop bit ,no parity bit
0001a4 e3a00d96 MOV r0,#0x2580
0001a8 ebfffffe BL uart4_init
;;;152
;;;153 {
;;;154
;;;155 uart3_puts("Test UART3\r\n"); // Send string to UART3
0001ac e28f002c ADR r0,|L1.480|
0001b0 ebfffffe BL uart3_puts
;;;156 uart4_puts("Test UART4\r\n"); // Send string to UART4
0001b4 e28f0034 ADR r0,|L1.496|
0001b8 ebfffffe BL uart4_puts
;;;157
;;;158 //uart0_puts(U3THR);
;;;159
;;;160 }
;;;161
;;;162 }
0001bc e8bd4010 POP {r4,lr}
0001c0 e3a00000 MOV r0,#0
0001c4 e12fff1e BX lr
ENDP
|L1.456|
0001c8 00a94d04 DCD 0x00a94d04
|L1.460|
0001cc 01c9c380 DCD 0x01c9c380
|L1.464|
0001d0 e002c000 DCD 0xe002c000
|L1.468|
0001d4 e000c000 DCD 0xe000c000
|L1.472|
0001d8 e01fc000 DCD 0xe01fc000
|L1.476|
0001dc 0e6149e4 DCD 0x0e6149e4
|L1.480|
0001e0 546573742055415254330d0a00 DCB "Test UART3\r\n",0
0001ed 00 DCB 0
0001ee 00 DCB 0
0001ef 00 DCB 0
|L1.496|
0001f0 546573742055415254340d0a00 DCB "Test UART4\r\n",0
0001fd 00 DCB 0
0001fe 00 DCB 0
0001ff 00 DCB 0
__ARM_use_no_argv EQU 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -