📄 2442lib.txt
字号:
000510 eafffff2 B |L1.1248| ;237
|L1.1300|
000514 e51f0078 LDR r0,|L1.1188| ;239
000518 e5900000 LDR r0,[r0,#0] ;239 ; whichUart
00051c e3500002 CMP r0,#2 ;239
000520 1a000007 BNE |L1.1348| ;239
000524 e1a00000 NOP ;241
|L1.1320|
000528 e51f00a8 LDR r0,|L1.1160| ;241
00052c e5900010 LDR r0,[r0,#0x10] ;241
000530 e3100001 TST r0,#1 ;241
000534 0afffffb BEQ |L1.1320| ;241
000538 e51f00b8 LDR r0,|L1.1160| ;242
00053c e5d00024 LDRB r0,[r0,#0x24] ;242
000540 eaffffe6 B |L1.1248| ;242
|L1.1348|
000544 eaffffe5 B |L1.1248|
ENDP
Uart_GetKey PROC
;;;247 char Uart_GetKey(void)
;;;248 {
000548 e51f00ac LDR r0,|L1.1188|
;;;249 if(whichUart==0)
00054c e5900000 LDR r0,[r0,#0] ; whichUart
000550 e3500000 CMP r0,#0
000554 1a000008 BNE |L1.1404|
;;;250 {
;;;251 if(rUTRSTAT0 & 0x1) //Receive data ready
000558 e3a00450 MOV r0,#0x50000000
00055c e5900010 LDR r0,[r0,#0x10]
000560 e3100001 TST r0,#1
000564 0a000002 BEQ |L1.1396|
;;;252 return RdURXH0();
000568 e3a00450 MOV r0,#0x50000000
00056c e5d00024 LDRB r0,[r0,#0x24]
;;;253 else
;;;254 return 0;
;;;255 }
;;;256 else if(whichUart==1)
;;;257 {
;;;258 if(rUTRSTAT1 & 0x1) //Receive data ready
;;;259 return RdURXH1();
;;;260 else
;;;261 return 0;
;;;262 }
;;;263 else if(whichUart==2)
;;;264 {
;;;265 if(rUTRSTAT2 & 0x1) //Receive data ready
;;;266 return RdURXH2();
;;;267 else
;;;268 return 0;
;;;269 }
;;;270 }
|L1.1392|
000570 e1a0f00e MOV pc,lr
|L1.1396|
000574 e3a00000 MOV r0,#0 ;254
000578 eafffffc B |L1.1392| ;254
|L1.1404|
00057c e51f00e0 LDR r0,|L1.1188| ;256
000580 e5900000 LDR r0,[r0,#0] ;256 ; whichUart
000584 e3500001 CMP r0,#1 ;256
000588 1a000008 BNE |L1.1456| ;256
00058c e51f0110 LDR r0,|L1.1156| ;258
000590 e5900010 LDR r0,[r0,#0x10] ;258
000594 e3100001 TST r0,#1 ;258
000598 0a000002 BEQ |L1.1448| ;258
00059c e51f0120 LDR r0,|L1.1156| ;259
0005a0 e5d00024 LDRB r0,[r0,#0x24] ;259
0005a4 eafffff1 B |L1.1392| ;259
|L1.1448|
0005a8 e3a00000 MOV r0,#0 ;261
0005ac eaffffef B |L1.1392| ;261
|L1.1456|
0005b0 e51f0114 LDR r0,|L1.1188| ;263
0005b4 e5900000 LDR r0,[r0,#0] ;263 ; whichUart
0005b8 e3500002 CMP r0,#2 ;263
0005bc 1a000008 BNE |L1.1508| ;263
0005c0 e51f0140 LDR r0,|L1.1160| ;265
0005c4 e5900010 LDR r0,[r0,#0x10] ;265
0005c8 e3100001 TST r0,#1 ;265
0005cc 0a000002 BEQ |L1.1500| ;265
0005d0 e51f0150 LDR r0,|L1.1160| ;266
0005d4 e5d00024 LDRB r0,[r0,#0x24] ;266
0005d8 eaffffe4 B |L1.1392| ;266
|L1.1500|
0005dc e3a00000 MOV r0,#0 ;268
0005e0 eaffffe2 B |L1.1392| ;268
|L1.1508|
0005e4 eaffffe1 B |L1.1392|
ENDP
Uart_SendByte PROC
;;;359 void Uart_SendByte(int data)
;;;360 {
0005e8 e92d4010 STMFD sp!,{r4,lr}
0005ec e1a04000 MOV r4,r0
;;;361 if(whichUart==0)
0005f0 e51f0154 LDR r0,|L1.1188|
0005f4 e5900000 LDR r0,[r0,#0] ; whichUart
0005f8 e3500000 CMP r0,#0
0005fc 1a000015 BNE |L1.1624|
;;;362 {
;;;363 if(data=='\n')
000600 e354000a CMP r4,#0xa
000604 1a000009 BNE |L1.1584|
;;;364 {
;;;365 while(!(rUTRSTAT0 & 0x2));
000608 e1a00000 NOP
|L1.1548|
00060c e3a00450 MOV r0,#0x50000000
000610 e5900010 LDR r0,[r0,#0x10]
000614 e3100002 TST r0,#2
000618 0afffffb BEQ |L1.1548|
;;;366 Delay(10); //because the slow response of hyper_terminal
00061c e3a0000a MOV r0,#0xa
000620 ebfffffe BL Delay
;;;367 WrUTXH0('\r');
000624 e3a0000d MOV r0,#0xd
000628 e3a01450 MOV r1,#0x50000000
00062c e5c10020 STRB r0,[r1,#0x20]
;;;368 }
;;;369 while(!(rUTRSTAT0 & 0x2)); //Wait until THR is empty.
|L1.1584|
000630 e1a00000 NOP
|L1.1588|
000634 e3a00450 MOV r0,#0x50000000
000638 e5900010 LDR r0,[r0,#0x10]
00063c e3100002 TST r0,#2
000640 0afffffb BEQ |L1.1588|
;;;370 Delay(10);
000644 e3a0000a MOV r0,#0xa
000648 ebfffffe BL Delay
;;;371 WrUTXH0(data);
00064c e3a00450 MOV r0,#0x50000000
000650 e5c04020 STRB r4,[r0,#0x20]
000654 ea000032 B |L1.1828|
;;;372 }
;;;373 else if(whichUart==1)
|L1.1624|
000658 e51f01bc LDR r0,|L1.1188|
00065c e5900000 LDR r0,[r0,#0] ; whichUart
000660 e3500001 CMP r0,#1
000664 1a000015 BNE |L1.1728|
;;;374 {
;;;375 if(data=='\n')
000668 e354000a CMP r4,#0xa
00066c 1a000009 BNE |L1.1688|
;;;376 {
;;;377 while(!(rUTRSTAT1 & 0x2));
000670 e1a00000 NOP
|L1.1652|
000674 e51f01f8 LDR r0,|L1.1156|
000678 e5900010 LDR r0,[r0,#0x10]
00067c e3100002 TST r0,#2
000680 0afffffb BEQ |L1.1652|
;;;378 Delay(10); //because the slow response of hyper_terminal
000684 e3a0000a MOV r0,#0xa
000688 ebfffffe BL Delay
;;;379 rUTXH1 = '\r';
00068c e3a0000d MOV r0,#0xd
000690 e51f1214 LDR r1,|L1.1156|
000694 e5c10020 STRB r0,[r1,#0x20]
;;;380 }
;;;381 while(!(rUTRSTAT1 & 0x2)); //Wait until THR is empty.
|L1.1688|
000698 e1a00000 NOP
|L1.1692|
00069c e51f0220 LDR r0,|L1.1156|
0006a0 e5900010 LDR r0,[r0,#0x10]
0006a4 e3100002 TST r0,#2
0006a8 0afffffb BEQ |L1.1692|
;;;382 Delay(10);
0006ac e3a0000a MOV r0,#0xa
0006b0 ebfffffe BL Delay
;;;383 rUTXH1 = data;
0006b4 e51f0238 LDR r0,|L1.1156|
0006b8 e5c04020 STRB r4,[r0,#0x20]
0006bc ea000018 B |L1.1828|
;;;384 }
;;;385 else if(whichUart==2)
|L1.1728|
0006c0 e51f0224 LDR r0,|L1.1188|
0006c4 e5900000 LDR r0,[r0,#0] ; whichUart
0006c8 e3500002 CMP r0,#2
0006cc 1a000014 BNE |L1.1828|
;;;386 {
;;;387 if(data=='\n')
0006d0 e354000a CMP r4,#0xa
0006d4 1a000009 BNE |L1.1792|
;;;388 {
;;;389 while(!(rUTRSTAT2 & 0x2));
0006d8 e1a00000 NOP
|L1.1756|
0006dc e51f025c LDR r0,|L1.1160|
0006e0 e5900010 LDR r0,[r0,#0x10]
0006e4 e3100002 TST r0,#2
0006e8 0afffffb BEQ |L1.1756|
;;;390 Delay(10); //because the slow response of hyper_terminal
0006ec e3a0000a MOV r0,#0xa
0006f0 ebfffffe BL Delay
;;;391 rUTXH2 = '\r';
0006f4 e3a0000d MOV r0,#0xd
0006f8 e51f1278 LDR r1,|L1.1160|
0006fc e5c10020 STRB r0,[r1,#0x20]
;;;392 }
;;;393 while(!(rUTRSTAT2 & 0x2)); //Wait until THR is empty.
|L1.1792|
000700 e1a00000 NOP
|L1.1796|
000704 e51f0284 LDR r0,|L1.1160|
000708 e5900010 LDR r0,[r0,#0x10]
00070c e3100002 TST r0,#2
000710 0afffffb BEQ |L1.1796|
;;;394 Delay(10);
000714 e3a0000a MOV r0,#0xa
000718 ebfffffe BL Delay
;;;395 rUTXH2 = data;
00071c e51f029c LDR r0,|L1.1160|
000720 e5c04020 STRB r4,[r0,#0x20]
;;;396 }
;;;397 }
|L1.1828|
000724 e8bd8010 LDMFD sp!,{r4,pc}
ENDP
Uart_SendString PROC
;;;400 void Uart_SendString(char *pt)
;;;401 {
000728 e92d4010 STMFD sp!,{r4,lr}
00072c e1a04000 MOV r4,r0
;;;402 while(*pt)
000730 e1a00000 NOP
|L1.1844|
000734 e5d40000 LDRB r0,[r4,#0]
000738 e3500000 CMP r0,#0
00073c 0a000002 BEQ |L1.1868|
;;;403 Uart_SendByte(*pt++);
000740 e4d40001 LDRB r0,[r4],#1
000744 ebfffffe BL Uart_SendByte
000748 eafffff9 B |L1.1844|
;;;404 }
|L1.1868|
00074c e8bd8010 LDMFD sp!,{r4,pc}
ENDP
Uart_Printf PROC
;;;408 void Uart_Printf(const char *fmt,...)
;;;409 {
000750 e92d000f STMFD sp!,{r0-r3}
000754 e52de004 STR lr,[sp,#-4]!
000758 e24ddf41 SUB sp,sp,#0x104
;;;410 va_list ap;
;;;411 char string[256];
;;;412
;;;413 va_start(ap,fmt);
00075c e28d0f43 ADD r0,sp,#0x10c
000760 e58d0100 STR r0,[sp,#0x100]
;;;414 vsprintf(string,fmt,ap);
000764 e28d2f40 ADD r2,sp,#0x100
000768 e59d1108 LDR r1,[sp,#0x108]
00076c e1a0000d MOV r0,sp
000770 ebfffffe BL vsprintf
;;;415 Uart_SendString(string);
000774 e1a0000d MOV r0,sp
000778 ebfffffe BL Uart_SendString
;;;416 va_end(ap);
00077c e3a00000 MOV r0,#0
000780 e58d0100 STR r0,[sp,#0x100]
;;;417 }
000784 e28ddf41 ADD sp,sp,#0x104
000788 e49df014 LDR pc,[sp],#0x14
ENDP
Uart_GetString PROC
;;;273 void Uart_GetString(char *string)
;;;274 {
00078c e92d4070 STMFD sp!,{r4-r6,lr}
000790 e1a04000 MOV r4,r0
;;;275 char *string2 = string;
000794 e1a06004 MOV r6,r4
;;;276 char c;
;;;277 while((c = Uart_Getch())!='\r')
000798 e1a00000 NOP
|L1.1948|
00079c ebfffffe BL Uart_Getch
0007a0 e1a05000 MOV r5,r0
0007a4 e350000d CMP r0,#0xd
0007a8 0a00000b BEQ |L1.2012|
;;;278 {
;;;279 if(c=='\b')
0007ac e3550008 CMP r5,#8
0007b0 1a000005 BNE |L1.1996|
;;;280 {
;;;281 if( (int)string2 < (int)string )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -