📄 fat16.lst
字号:
205 mmc_read_page(0,i+1,SectorBuffer);
\ ??fatInit_3:
\ 000000CA 6E1C ADD R6,R5,#+1
\ 000000CC 009A LDR R2,[SP, #+0]
\ 000000CE 311C MOV R1,R6
\ 000000D0 0020 MOV R0,#+0
\ 000000D2 ........ _BLF mmc_read_page,??mmc_read_page??rT
206 for(j=0;j<256;j++)
\ 000000D6 0021 MOV R1,#+0
207 {
208 FatCache[i*256+j] = SectorBuffer[j*2] + (SectorBuffer[j*2+1] << 8);
\ ??fatInit_4:
\ 000000D8 8020 MOV R0,#+128
\ 000000DA C001 LSL R0,R0,#+7 ;; #+16384
\ 000000DC 4A00 LSL R2,R1,#+1
\ 000000DE 0F4B LDR R3,??fatInit_0+0x10 ;; ClusterBuffer
\ 000000E0 9A18 ADD R2,R3,R2
\ 000000E2 1218 ADD R2,R2,R0
\ 000000E4 2802 LSL R0,R5,#+8
\ 000000E6 4018 ADD R0,R0,R1
\ 000000E8 8300 LSL R3,R0,#+2
\ 000000EA 1078 LDRB R0,[R2, #+0]
\ 000000EC 5278 LDRB R2,[R2, #+1]
\ 000000EE 1202 LSL R2,R2,#+8
\ 000000F0 8018 ADD R0,R0,R2
\ 000000F2 F850 STR R0,[R7, R3]
209 }
\ 000000F4 491C ADD R1,R1,#+1
\ 000000F6 8020 MOV R0,#+128
\ 000000F8 4000 LSL R0,R0,#+1 ;; #+256
\ 000000FA 8142 CMP R1,R0
\ 000000FC ECDB BLT ??fatInit_4
210 }
\ 000000FE 351C MOV R5,R6
\ ??fatInit_2:
\ 00000100 606A LDR R0,[R4, #+36]
\ 00000102 8542 CMP R5,R0
\ 00000104 E1D3 BCC ??fatInit_3
211 return 0;
\ 00000106 0020 MOV R0,#+0
\ 00000108 .... B ?Subroutine36
\ 0000010A C046 NOP
\ ??fatInit_0:
\ 0000010C ........ DC32 ClusterBuffer + 16395
\ 00000110 ........ DC32 `?<Constant "\\nNumber of Fats : %4d">`
\ 00000114 ........ DC32 ClusterBuffer + 16387
\ 00000118 ........ DC32 ClusterBuffer + 16428
\ 0000011C ........ DC32 ClusterBuffer
212 }
\ In segment CODE, align 4, keep-with-next
\ ?Subroutine36:
\ 00000000 F8BC POP {R3-R7}
\ 00000002 02BC POP {R1}
\ 00000004 0847 BX R1 ;; return
213 //一个测试程序
\ In segment CODE, align 4, keep-with-next
214 void fat16_Nandflash_test(void)
215 {
\ fat16_Nandflash_test:
\ 00000000 70B5 PUSH {R4-R6,LR}
\ 00000002 87B0 SUB SP,#+28
216 int x,result,i;
217
218 char buff[]="fangajfdklsafjasfa;lfs;l";
\ 00000004 254C LDR R4,??fat16_Nandflash_test_0 ;; `?<Constant "fangajfdklsafjasfa;lfs;l">`
\ 00000006 6846 MOV R0,SP
\ 00000008 1C22 MOV R2,#+28
\ ??fat16_Nandflash_test_1:
\ 0000000A 121F SUB R2,R2,#+4
\ 0000000C A158 LDR R1,[R4, R2]
\ 0000000E 8150 STR R1,[R0, R2]
\ 00000010 FBD1 BNE ??fat16_Nandflash_test_1
219 char buff1[]="hzlitai elec. CO.,Ltd.";
220
221 if(fat_format(NAND_FLASH_Drv,DISK_16M,PART_TYPE_FAT16))
\ 00000012 0622 MOV R2,#+6
\ 00000014 1021 MOV R1,#+16
\ 00000016 0120 MOV R0,#+1
\ 00000018 ........ BL fat_format
\ 0000001C 0028 CMP R0,#+0
\ 0000001E 39D0 BEQ ??fat16_Nandflash_test_2
222 {
223 fatInit();
\ 00000020 ........ BL fatInit
224 /*result=fat_mkdir("\\abcde");
225 x = fat_creat("\\abcde\\fang123.txt", 0x27);//0x27:txt file?
226 //Uart_Printf("\nfat_creat's file handle=%d",x);
227 fat_write(x, buff, 20);//将buff中10个字节内容写入文件x
228 fat_write(x, buff1, 10);
229 fat_lseek(x, 0, SEEK_SET);
230 memset(buff, 0, sizeof(buff));
231 AT91F_DBGU_Printk("\nfat_read buff=");
232 fat_read(x, buff, 30);
233 for(i=0;i<30;i++)
234 AT91F_DBGU_Printk("%c",buff[i]);
235 fat_close(x);
236
237 x=fat_open("\\abcde\\fang123.txt");
238 AT91F_DBGU_Printk("\nfat_open's result=%d",x);
239 AT91F_DBGU_Printk("\nfat_read buff=");
240 fat_read(x, buff, 15);
241 for(i=0;i<15;i++)
242 AT91F_DBGU_Printk("%c",buff[i]);
243 fat_close(x);
244
245 result=fat_rename("\\abcde\\fang123.txt", "fang321.txt");
246 AT91F_DBGU_Printk("\nfat_rename's result=%d",x);*/
247
248 x=fat_open("\\abcde\\fang321.txt");
\ 00000024 201C MOV R0,R4
\ 00000026 1C30 ADD R0,#+28
\ 00000028 ........ BL fat_open
\ 0000002C 061C MOV R6,R0
249 AT91F_DBGU_Printk("\nfat_open's result=%d",result);
^
Warning[Pe223]: function "AT91F_DBGU_Printk" declared implicitly
AT91F_DBGU_Printk("\nfat_open's result=%d",result);
^
"G:\AT91_ENERGY\ATMEL_ARM\mmssys\mmc_sd\fat16.c",249 Warning[Pe549]: variable
"result" is used before its value is set
char buff1[]="hzlitai elec. CO.,Ltd.";
^
"G:\AT91_ENERGY\ATMEL_ARM\mmssys\mmc_sd\fat16.c",219 Warning[Pe177]: variable
"buff1" was declared but never referenced
\ 0000002E 291C MOV R1,R5
\ 00000030 201C MOV R0,R4
\ 00000032 3030 ADD R0,#+48
\ 00000034 ........ _BLF AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
250 AT91F_DBGU_Printk("\nfat_read buff=",result);
\ 00000038 291C MOV R1,R5
\ 0000003A 201C MOV R0,R4
\ 0000003C 4830 ADD R0,#+72
\ 0000003E ........ _BLF AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
251 fat_read(x, buff, 20);
\ 00000042 1422 MOV R2,#+20
\ 00000044 6946 MOV R1,SP
\ 00000046 301C MOV R0,R6
\ 00000048 ........ BL fat_read
252 for(i=0;i<20;i++)
\ 0000004C 0025 MOV R5,#+0
253 AT91F_DBGU_Printk("%c",buff[i]);
\ ??fat16_Nandflash_test_3:
\ 0000004E 6846 MOV R0,SP
\ 00000050 415D LDRB R1,[R0, R5]
\ 00000052 13A0 ADR R0,??fat16_Nandflash_test_0+0x4 ;; "%c"
\ 00000054 ........ _BLF AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
\ 00000058 6D1C ADD R5,R5,#+1
\ 0000005A 142D CMP R5,#+20
\ 0000005C F7DB BLT ??fat16_Nandflash_test_3
254
255 result=fat_remove("\\abcde\\fang321.txt");
\ 0000005E 201C MOV R0,R4
\ 00000060 1C30 ADD R0,#+28
\ 00000062 ........ BL fat_remove
\ 00000066 011C MOV R1,R0
256 AT91F_DBGU_Printk("\nfat_remove's result=%d",result);
\ 00000068 201C MOV R0,R4
\ 0000006A 5830 ADD R0,#+88
\ 0000006C ........ _BLF AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
257
258 x=fat_open("\\abcde\\fang321.txt");
\ 00000070 201C MOV R0,R4
\ 00000072 1C30 ADD R0,#+28
\ 00000074 ........ BL fat_open
259 AT91F_DBGU_Printk("\nfat_open's result=%d",x);
\ 00000078 011C MOV R1,R0
\ 0000007A 201C MOV R0,R4
\ 0000007C 3030 ADD R0,#+48
\ 0000007E ........ _BLF AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
260
261 //result=fat_rename("\\abcde\\", "abcd12");
262 //Uart_Printf("\nfat_rename's result=%d",result);
263
264 result=fat_rmdir("\\abcde");
\ 00000082 201C MOV R0,R4
\ 00000084 7030 ADD R0,#+112
\ 00000086 ........ BL fat_rmdir
265 AT91F_DBGU_Printk("\nfat_rmdir's result=%d\n",result);
\ 0000008A 011C MOV R1,R0
\ 0000008C 7834 ADD R4,#+120
\ 0000008E 201C MOV R0,R4
\ 00000090 ........ _BLF AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
266 }
267 }
\ ??fat16_Nandflash_test_2:
\ 00000094 07B0 ADD SP,#+28
\ 00000096 70BC POP {R4-R6}
\ 00000098 01BC POP {R0}
\ 0000009A 0047 BX R0 ;; return
\ ??fat16_Nandflash_test_0:
\ 0000009C ........ DC32 `?<Constant "fangajfdklsafjasfa;lfs;l">`
\ 000000A0 25630000 DC8 "%c",+0
268
\ In segment CODE, align 4, keep-with-next
269 void FlushFAT()
270 {
\ FlushFAT:
\ 00000000 F0B5 PUSH {R4-R7,LR}
271 int i,j;
272 mmc_read_page(0,0,SectorBuffer);
\ 00000002 .... LDR R4,??DataTable25 ;; ClusterBuffer
\ 00000004 8020 MOV R0,#+128
\ 00000006 C001 LSL R0,R0,#+7 ;; #+16384
\ 00000008 2518 ADD R5,R4,R0
\ 0000000A 2A1C MOV R2,R5
\ 0000000C 0021 MOV R1,#+0
\ 0000000E 0020 MOV R0,#+0
\ 00000010 ........ _BLF mmc_read_page,??mmc_read_page??rT
273 memcpy(ClusterBuffer[0], SectorBuffer, BytesPerSector); //backup Sector0
\ 00000014 .... LDR R0,??DataTable23 ;; fat_get + 32
\ 00000016 0068 LDR R0,[R0, #+0]
\ 00000018 .... LDR R1,??DataTable24 ;; ClusterBuffer + 16384
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -