📄 main.txt
字号:
00011c 3a203132
000120 39353734
000124 34363330
000128 200d0a00
|L5.300|
00012c 2a20456d DCB "* Email : armfly@qq.com \r\n",0
000130 61696c20
000134 3a206172
000138 6d666c79
00013c 4071712e
000140 636f6d20
000144 0d0a00
000147 00 DCB 0
|L5.328|
000148 2a20436f DCB "* Copyright www.armfly.com ",176,178,184,187,192,179,181
00014c 70797269
000150 67687420
000154 7777772e
000158 61726d66
00015c 6c792e63
000160 6f6d20b0
000164 b2b8bbc0
000168 b3b5
00016a e7d7d30d DCB 231,215,211,"\r\n",0
00016e 0a00
AREA ||i.ReadFileData||, CODE, READONLY, ALIGN=2
REQUIRE _printf_percent
REQUIRE _printf_d
REQUIRE _printf_int_dec
REQUIRE _printf_s
REQUIRE _printf_str
REQUIRE _printf_str
REQUIRE _printf_str
REQUIRE _printf_str
ReadFileData PROC
;;;395 */
;;;396 static void ReadFileData(void)
000000 b510 PUSH {r4,lr}
;;;397 {
000002 f5ad6d96 SUB sp,sp,#0x4b0
;;;398 /* 本函数使用的局部变量占用较多,请修改启动文件,保证堆栈空间够用 */
;;;399 FRESULT result;
;;;400 FATFS fs;
;;;401 FIL file;
;;;402 DIR DirInf;
;;;403 uint32_t bw;
;;;404 char buf[60];
;;;405
;;;406
;;;407 /* 挂载文件系统 */
;;;408 result = f_mount(0, &fs); /* Mount a logical drive */
000006 a9a0 ADD r1,sp,#0x280
000008 2000 MOVS r0,#0
00000a f7fffffe BL f_mount
00000e 4604 MOV r4,r0
;;;409 if (result != FR_OK)
000010 b11c CBZ r4,|L6.26|
;;;410 {
;;;411 printf("挂载文件系统失败(%d)\r\n", result);
000012 4621 MOV r1,r4
000014 a025 ADR r0,|L6.172|
000016 f7fffffe BL __2printf
|L6.26|
;;;412 }
;;;413
;;;414 /* 打开根文件夹 */
;;;415 result = f_opendir(&DirInf, "/"); /* 如果不带参数,则从当前目录开始armfly.txt */
00001a a12a ADR r1,|L6.196|
00001c a810 ADD r0,sp,#0x40
00001e f7fffffe BL f_opendir
000022 4604 MOV r4,r0
;;;416 if (result != FR_OK)
000024 b134 CBZ r4,|L6.52|
;;;417 {
;;;418 printf("打开根目录失败(%d)\r\n", result);
000026 4621 MOV r1,r4
000028 a027 ADR r0,|L6.200|
00002a f7fffffe BL __2printf
|L6.46|
;;;419 return;
;;;420 }
;;;421
;;;422 /* 打开文件 */
;;;423 result = f_open(&file, "Speed11.txt", FA_OPEN_EXISTING | FA_READ);
;;;424 if (result != FR_OK)
;;;425 {
;;;426 printf("Don't Find File : armfly.txt\r\n");
;;;427 return;
;;;428 }
;;;429
;;;430 /* 读取文件 */
;;;431 // while(!feof(&file))
;;;432 // result = f_read(&file, &buf, sizeof(buf), &bw); //&buf is aim reg , sizeof is number
;;;433 // //
;;;434 result = f_read(&file, &buf, sizeof(buf) - 1, &bw); //&buf is aim reg , sizeof is number
;;;435 if (bw > 0)
;;;436 {
;;;437 buf[bw] = 0;
;;;438 printf("\r\narmfly.txt 文件内容 : \r\n%s\r\n", buf);
;;;439 ascii_int(buf); ////int to string ascii_int uint receivedtxt
;;;440 printf("%s\r\n", receivedtxt[0]);
;;;441 printf("%s\r\n", receivedtxt[1]);
;;;442 printf("%s\r\n", receivedtxt[2]);
;;;443 }
;;;444 else
;;;445 {
;;;446 printf("\r\narmfly.txt 文件内容 : \r\n");
;;;447 }
;;;448
;;;449 /* 关闭文件*/
;;;450 f_close(&file);
;;;451
;;;452 /* 卸载文件系统 */
;;;453 f_mount(0, NULL);
;;;454 }
00002e f50d6d96 ADD sp,sp,#0x4b0
000032 bd10 POP {r4,pc}
|L6.52|
000034 2201 MOVS r2,#1 ;423
000036 a12a ADR r1,|L6.224|
000038 a817 ADD r0,sp,#0x5c ;423
00003a f7fffffe BL f_open
00003e 4604 MOV r4,r0 ;423
000040 b11c CBZ r4,|L6.74|
000042 a02a ADR r0,|L6.236|
000044 f7fffffe BL __2printf
000048 e7f1 B |L6.46|
|L6.74|
00004a ab0f ADD r3,sp,#0x3c ;434
00004c 223b MOVS r2,#0x3b ;434
00004e 4669 MOV r1,sp ;434
000050 a817 ADD r0,sp,#0x5c ;434
000052 f7fffffe BL f_read
000056 4604 MOV r4,r0 ;434
000058 980f LDR r0,[sp,#0x3c] ;435
00005a b1d0 CBZ r0,|L6.146|
00005c 2000 MOVS r0,#0 ;437
00005e 9a0f LDR r2,[sp,#0x3c] ;437
000060 f80d0002 STRB r0,[sp,r2] ;437
000064 4669 MOV r1,sp ;438
000066 a029 ADR r0,|L6.268|
000068 f7fffffe BL __2printf
00006c 4668 MOV r0,sp ;439
00006e f7fffffe BL ascii_int
000072 482e LDR r0,|L6.300|
000074 6801 LDR r1,[r0,#0] ;440 ; receivedtxt
000076 a02e ADR r0,|L6.304|
000078 f7fffffe BL __2printf
00007c 482b LDR r0,|L6.300|
00007e 6841 LDR r1,[r0,#4] ;441 ; receivedtxt
000080 a02b ADR r0,|L6.304|
000082 f7fffffe BL __2printf
000086 4829 LDR r0,|L6.300|
000088 6881 LDR r1,[r0,#8] ;442 ; receivedtxt
00008a a029 ADR r0,|L6.304|
00008c f7fffffe BL __2printf
000090 e002 B |L6.152|
|L6.146|
000092 a029 ADR r0,|L6.312|
000094 f7fffffe BL __2printf
|L6.152|
000098 a817 ADD r0,sp,#0x5c ;450
00009a f7fffffe BL f_close
00009e 2100 MOVS r1,#0 ;453
0000a0 4608 MOV r0,r1 ;453
0000a2 f7fffffe BL f_mount
0000a6 bf00 NOP
0000a8 e7c1 B |L6.46|
;;;455
ENDP
0000aa 0000 DCW 0x0000
|L6.172|
0000ac b9d2d4d8 DCB 185,210,212,216,206,196,188,254,207,181,205,179,202,167,176
0000b0 cec4bcfe
0000b4 cfb5cdb3
0000b8 caa7b0
0000bb dc282564 DCB 220,"(%d)\r\n",0
0000bf 290d0a00
0000c3 00 DCB 0
|L6.196|
0000c4 2f00 DCB "/",0
0000c6 00 DCB 0
0000c7 00 DCB 0
|L6.200|
0000c8 b4f2bfaa DCB 180,242,191,170,184,249,196,191,194,188,202,167,176,220,"("
0000cc b8f9c4bf
0000d0 c2bccaa7
0000d4 b0dc28
0000d7 2564290d DCB "%d)\r\n",0
0000db 0a00
0000dd 00 DCB 0
0000de 00 DCB 0
0000df 00 DCB 0
|L6.224|
0000e0 53706565 DCB "Speed11.txt",0
0000e4 6431312e
0000e8 74787400
|L6.236|
0000ec 446f6e27 DCB "Don't Find File : armfly.txt\r\n",0
0000f0 74204669
0000f4 6e642046
0000f8 696c6520
0000fc 3a206172
000100 6d666c79
000104 2e747874
000108 0d0a00
00010b 00 DCB 0
|L6.268|
00010c 0d0a6172 DCB "\r\narmfly.txt ",206,196,188,254,196,218,200,221," : \r"
000110 6d666c79
000114 2e747874
000118 20cec4bc
00011c fec4dac8
000120 dd203a20
000124 0d
000125 0a25730d DCB "\n%s\r\n",0
000129 0a00
00012b 00 DCB 0
|L6.300|
DCD receivedtxt
|L6.304|
000130 25730d0a DCB "%s\r\n",0
000134 00
000135 00 DCB 0
000136 00 DCB 0
000137 00 DCB 0
|L6.312|
000138 0d0a6172 DCB "\r\narmfly.txt ",206,196,188,254,196,218,200,221," : \r"
00013c 6d666c79
000140 2e747874
000144 20cec4bc
000148 fec4dac8
00014c dd203a20
000150 0d
000151 0a00 DCB "\n",0
000153 00 DCB 0
AREA ||i.ViewRootDir||, CODE, READONLY, ALIGN=2
REQUIRE _printf_percent
REQUIRE _printf_d
REQUIRE _printf_int_dec
REQUIRE _printf_s
REQUIRE _printf_str
ViewRootDir PROC
;;;268 */
;;;269 static void ViewRootDir(void)
000000 b530 PUSH {r4,r5,lr}
;;;270 {
000002 f5ad7d1f SUB sp,sp,#0x27c
;;;271 /* 本函数使用的局部变量占用较多,请修改启动文件,保证堆栈空间够用 */
;;;272 FRESULT result;
;;;273 FATFS fs;
;;;274 DIR DirInf;
;;;275 FILINFO FileInf;
;;;276
;;;277 uint8_t tmpStr[20];
;;;278 uint32_t cnt = 0;
000006 2500 MOVS r5,#0
;;;279
;;;280 /* 挂载文件系统 */
;;;281 result = f_mount(0, &fs); /* Mount a logical drive */
000008 a913 ADD r1,sp,#0x4c
00000a 2000 MOVS r0,#0
00000c f7fffffe BL f_mount
000010 4604 MOV r4,r0
;;;282 if (result != FR_OK)
000012 b11c CBZ r4,|L7.28|
;;;283 {
;;;284 printf("挂载文件系统失败 (%d)\r\n", result);
000014 4621 MOV r1,r4
000016 a02a ADR r0,|L7.192|
000018 f7fffffe BL __2printf
|L7.28|
;;;285 }
;;;286
;;;287 /* 打开根文件夹 */
;;;288 result = f_opendir(&DirInf, "/"); /* 如果不带参数,则从当前目录开始 */
00001c a12e ADR r1,|L7.216|
00001e a80c ADD r0,sp,#0x30
000020 f7fffffe BL f_opendir
000024 4604 MOV r4,r0
;;;289 if (result != FR_OK)
000026 b134 CBZ r4,|L7.54|
;;;290 {
;;;291 printf("打开根目录失败 (%d)\r\n", result);
000028 4621 MOV r1,r4
00002a a02c ADR r0,|L7.220|
00002c f7fffffe BL __2printf
|L7.48|
;;;292 return;
;;;293 }
;;;294
;;;295 /* 读取当前文件夹下的文件和目录 */
;;;296 printf("Name\t\tTyepe\t\tSize\r\n");
;;;297 for (cnt = 0; ;cnt++)
;;;298 {
;;;299 result = f_readdir(&DirInf,&FileInf); /* 读取目录项,索引会自动下移 */
;;;300 if (result != FR_OK || FileInf.fname[0] == 0)
;;;301 {
;;;302 break;
;;;303 }
;;;304
;;;305 if (FileInf.fname[0] == '.')
;;;306 {
;;;307 continue;
;;;308 }
;;;309
;;;310 printf("%s", FileInf.fname);
;;;311 if (strlen(FileInf.fname) < 8) /* 对齐 */
;;;312 {
;;;313 printf("\t\t");
;;;314 }
;;;315 else
;;;316 {
;;;317 printf("\t");
;;;318 }
;;;319 if (FileInf.fattrib == AM_DIR)
;;;320 {
;;;321 printf("目录\t\t");
;;;322 }
;;;323 else
;;;324 {
;;;325 printf("文件\t\t");
;;;326 }
;;;327 printf("%d\r\n", FileInf.fsize);
;;;328 sprintf((char *)tmpStr, "%d", FileInf.fsize);
;;;329 }
;;;330
;;;331 /* 卸载文件系统 */
;;;332 f_mount(0, NULL);
;;;333 }
000030 f50d7d1f ADD sp,sp,#0x27c
000034 bd30 POP {r4,r5,pc}
|L7.54|
000036 a02f ADR r0,|L7.244|
000038 f7fffffe BL __2printf
00003c 2500 MOVS r5,#0 ;297
00003e bf00 NOP ;297
|L7.64|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -