⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bfsa_internal.lst

📁 at91sam7x256 FREERTOS sd卡的读写程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
    530              return FALSE;
   \                     ??isValidFileName_1:
   \   00000006   0020               MOV         R0,#+0
   \   00000008   33E0               B           ??isValidFileName_2
    531            }
    532            if (*fileName == '.')   // File name can't be only an extension
   \                     ??isValidFileName_0:
   \   0000000A   2078               LDRB        R0,[R4, #+0]
   \   0000000C   2E28               CMP         R0,#+46
   \   0000000E   FAD0               BEQ         ??isValidFileName_1
    533            {
    534              return FALSE;
    535            }
    536            // Filename
    537            for (_c=0;
   \   00000010   0025               MOV         R5,#+0
   \                     ??isValidFileName_3:
   \   00000012   6019               ADD         R0,R4,R5
   \   00000014   0178               LDRB        R1,[R0, #+0]
   \   00000016   0029               CMP         R1,#+0
   \   00000018   0BD0               BEQ         ??isValidFileName_4
   \   0000001A   2E29               CMP         R1,#+46
   \   0000001C   09D0               BEQ         ??isValidFileName_4
    538                 _c<8 && fileName[_c]!='\0' && fileName[_c]!='.';
    539                 _c++)
    540            {
    541              if (!isValidFileNameChar(fileName[_c]))
   \   0000001E   081C               MOV         R0,R1
   \   00000020   ........           _BLF        isValidFileNameChar,??isValidFileNameChar??rT
   \   00000024   0028               CMP         R0,#+0
   \   00000026   EED0               BEQ         ??isValidFileName_1
    542              {
    543                return FALSE;
    544              }
    545            }
   \   00000028   6D1C               ADD         R5,R5,#+1
   \   0000002A   2806               LSL         R0,R5,#+24
   \   0000002C   000E               LSR         R0,R0,#+24
   \   0000002E   0828               CMP         R0,#+8
   \   00000030   EFD3               BCC         ??isValidFileName_3
    546            if (fileName[_c]!='\0' && fileName[_c]!='.') // Wrong size
   \                     ??isValidFileName_4:
   \   00000032   2D06               LSL         R5,R5,#+24
   \   00000034   2D0E               LSR         R5,R5,#+24
   \   00000036   6419               ADD         R4,R4,R5
   \   00000038   2078               LDRB        R0,[R4, #+0]
   \   0000003A   0028               CMP         R0,#+0
   \   0000003C   01D0               BEQ         ??isValidFileName_5
   \   0000003E   2E28               CMP         R0,#+46
   \   00000040   E1D1               BNE         ??isValidFileName_1
    547            {
    548              return FALSE;
    549            }
    550          
    551            // File extension
    552            if (fileName[_c]=='.')
   \                     ??isValidFileName_5:
   \   00000042   2E28               CMP         R0,#+46
   \   00000044   14D1               BNE         ??isValidFileName_6
    553            {
    554              fileName = &fileName[_c+1];
   \   00000046   641C               ADD         R4,R4,#+1
    555              for (_c=0;
   \   00000048   0025               MOV         R5,#+0
   \                     ??isValidFileName_7:
   \   0000004A   6019               ADD         R0,R4,R5
   \   0000004C   0178               LDRB        R1,[R0, #+0]
   \   0000004E   0029               CMP         R1,#+0
   \   00000050   09D0               BEQ         ??isValidFileName_8
    556               _c<3 && fileName[_c]!='\0';
    557               _c++)
    558              {
    559                if (!isValidFileNameChar(fileName[_c]))
   \   00000052   081C               MOV         R0,R1
   \   00000054   ........           _BLF        isValidFileNameChar,??isValidFileNameChar??rT
   \   00000058   0028               CMP         R0,#+0
   \   0000005A   D4D0               BEQ         ??isValidFileName_1
    560                {
    561                  return FALSE;
    562                }
    563              }
   \   0000005C   6D1C               ADD         R5,R5,#+1
   \   0000005E   2806               LSL         R0,R5,#+24
   \   00000060   000E               LSR         R0,R0,#+24
   \   00000062   0328               CMP         R0,#+3
   \   00000064   F1D3               BCC         ??isValidFileName_7
    564              if (fileName[_c]!='\0') // Wrong extension size
   \                     ??isValidFileName_8:
   \   00000066   2D06               LSL         R5,R5,#+24
   \   00000068   2D0E               LSR         R5,R5,#+24
   \   0000006A   605D               LDRB        R0,[R4, R5]
   \   0000006C   0028               CMP         R0,#+0
   \   0000006E   CAD1               BNE         ??isValidFileName_1
    565              {
    566                return FALSE;
    567              }
    568            }
    569          
    570            return TRUE;
   \                     ??isValidFileName_6:
   \   00000070   0120               MOV         R0,#+1
   \                     ??isValidFileName_2:
   \   00000072   30BC               POP         {R4,R5}
   \   00000074   02BC               POP         {R1}
   \   00000076   0847               BX          R1                 ;; return
    571          }
    572          
    573          /*****************************************************************
    574          *
    575          *
    576          * S U B - R O U T I N E  : padFileName
    577          *
    578          *-----------------------------------------------------------------
    579          *
    580          * void padFileName(const char *filename, char* strFileName)
    581          *
    582          * Object :
    583          *   This function add spaces to filename to have always a filename of 8+3 chars.
    584          *   Eg. filename = "test.exe", strFileName = "test    exe"
    585          *
    586          * Argument:
    587          *       FileName             :[IN] Valid Filename.
    588          *       strFileName          :[OUT] filename padded, allocated by user to [8+3]
    589          *
    590          * Return value :
    591          *       returns First cluster of the file,
    592          *       or 0 if no matching file was found
    593          *****************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    594          void padFileName(const char *filename, char* strFileName)
    595          {
   \                     padFileName:
   \   00000000   30B5               PUSH        {R4,R5,LR}
    596            UCHAR i;
    597            char *puc = strFileName;
   \   00000002   0A1C               MOV         R2,R1
    598          
    599            if (!filename || !strFileName)
   \   00000004   0028               CMP         R0,#+0
   \   00000006   1BD0               BEQ         ??padFileName_0
   \   00000008   0029               CMP         R1,#+0
   \   0000000A   19D0               BEQ         ??padFileName_0
    600            {
    601              return;
    602            }
    603          
    604            for( i=0; i<8+3; i++ )
   \   0000000C   0023               MOV         R3,#+0
   \   0000000E   0024               MOV         R4,#+0
    605            {
    606              strFileName[i] = 0x20;
   \                     ??padFileName_1:
   \   00000010   2025               MOV         R5,#+32
   \   00000012   0D55               STRB        R5,[R1, R4]
    607            }
   \   00000014   641C               ADD         R4,R4,#+1
   \   00000016   2506               LSL         R5,R4,#+24
   \   00000018   2D0E               LSR         R5,R5,#+24
   \   0000001A   0B2D               CMP         R5,#+11
   \   0000001C   F8D3               BCC         ??padFileName_1
    608            strFileName[8+3] = '\0';
   \   0000001E   CB72               STRB        R3,[R1, #+11]
    609          
    610            for (i=0; i<BFSA_MAX_FILENAME_LEN && filename[i]!='\0'; i++)
   \                     ??padFileName_2:
   \   00000020   C418               ADD         R4,R0,R3
   \   00000022   2578               LDRB        R5,[R4, #+0]
   \   00000024   002D               CMP         R5,#+0
   \   00000026   0BD0               BEQ         ??padFileName_0
    611            {
    612              if (filename[i]=='.')
   \   00000028   2E2D               CMP         R5,#+46
   \   0000002A   02D1               BNE         ??padFileName_3
    613              {
    614                puc = strFileName + 8;  // The '.' is not retrived
   \   0000002C   0A1C               MOV         R2,R1
   \   0000002E   0832               ADD         R2,#+8
   \   00000030   01E0               B           ??padFileName_4
    615              }
    616              else
    617              {
    618                *puc = filename[i];
   \                     ??padFileName_3:
   \   00000032   1570               STRB        R5,[R2, #+0]
    619                puc++;
   \   00000034   521C               ADD         R2,R2,#+1
    620              }
    621            }
   \                     ??padFileName_4:
   \   00000036   5B1C               ADD         R3,R3,#+1
   \   00000038   1C06               LSL         R4,R3,#+24
   \   0000003A   240E               LSR         R4,R4,#+24
   \   0000003C   0D2C               CMP         R4,#+13
   \   0000003E   EFD3               BCC         ??padFileName_2
   \                     ??padFileName_0:
   \   00000040   30BC               POP         {R4,R5}
   \   00000042   01BC               POP         {R0}
   \   00000044   0047               BX          R0                 ;; return
    622          }
    623          
    624          
    625          /*****************************************************************
    626          *
    627          *
    628          * S U B - R O U T I N E  : findEntry
    629          *
    630          *-----------------------------------------------------------------
    631          *
    632          * USHORT findEntry(char* fileName)
    633          *
    634          * Object :
    635          *   This function looks for a file in current directory.
    636          *
    637          * Argument:
    638          *       FileName             :[IN] Valid Filename to find.
    639          *
    640          * Return value :
    641          *       returns entry address,
    642          *       or 0 if no matching file was found
    643          *****************************************************************/

   \                                 In segment CODE, align 4, keep-with-next
    644          int findEntry(char *fileName)
    645          {
   \                     findEntry:
   \   00000000   F0B5               PUSH        {R4-R7,LR}
   \   00000002   90B0               SUB         SP,#+64
    646            UCHAR *_flashDirEnt = NULL;             // Point to a directory entry DIR_Name
    647            UCHAR  pDirEnt[DIRECTORY_ENTRIE_SIZE];
    648            USHORT _currentDirClus = BFSA_current_dir.DirStart;
   \   00000004   ....               LDR         R1,??Subroutine16_0  ;; BFSA_current_dir + 102
   \   00000006   0091               STR         R1,[SP, #+0]
   \   00000008   0C88               LDRH        R4,[R1, #+0]
    649            USHORT _currentEntry;
    650            USHORT _numberDirEntryPerCluster;
    651            char strFileName[8+3+1] ="";   // File name space padded.
   \   0000000A   0AA9               ADD         R1,SP,#+40
   \   0000000C   0022               MOV         R2,#+0
   \   0000000E   0A60               STR         R2,[R1, #0]
   \   00000010   4A60               STR         R2,[R1, #+4]
   \   00000012   8A60               STR         R2,[R1, #+8]
   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -