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

📄 bfsa_internal.lst

📁 at91sam7x256 FREERTOS sd卡的读写程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00000004   01D1               BNE         ??isValidFileName_0
    530            {
    531              return FALSE;
   \                     ??isValidFileName_1:
   \   00000006   0020               MOV         R0,#+0
   \   00000008   33E0               B           ??isValidFileName_2
    532            }
    533            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
    534            {
    535              return FALSE;
    536            }
    537            // Filename
    538            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
    539                 _c<8 && fileName[_c]!='\0' && fileName[_c]!='.';
    540                 _c++)
    541            {
    542              if (!isValidFileNameChar(fileName[_c]))
   \   0000001E   081C               MOV         R0,R1
   \   00000020   ........           _BLF        isValidFileNameChar,??isValidFileNameChar??rT
   \   00000024   0028               CMP         R0,#+0
   \   00000026   EED0               BEQ         ??isValidFileName_1
    543              {
    544                return FALSE;
    545              }
    546            }
   \   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
    547            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
    548            {
    549              return FALSE;
    550            }
    551          
    552            // File extension
    553            if (fileName[_c]=='.')
   \                     ??isValidFileName_5:
   \   00000042   2E28               CMP         R0,#+46
   \   00000044   14D1               BNE         ??isValidFileName_6
    554            {
    555              fileName = &fileName[_c+1];
   \   00000046   641C               ADD         R4,R4,#+1
    556              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
    557               _c<3 && fileName[_c]!='\0';
    558               _c++)
    559              {
    560                if (!isValidFileNameChar(fileName[_c]))
   \   00000052   081C               MOV         R0,R1
   \   00000054   ........           _BLF        isValidFileNameChar,??isValidFileNameChar??rT
   \   00000058   0028               CMP         R0,#+0
   \   0000005A   D4D0               BEQ         ??isValidFileName_1
    561                {
    562                  return FALSE;
    563                }
    564              }
   \   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
    565              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
    566              {
    567                return FALSE;
    568              }
    569            }
    570          
    571            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
    572          }
    573          
    574          /*****************************************************************
    575          *
    576          *
    577          * S U B - R O U T I N E  : padFileName
    578          *
    579          *-----------------------------------------------------------------
    580          *
    581          * void padFileName(const char *filename, char* strFileName)
    582          *
    583          * Object :
    584          *   This function add spaces to filename to have always a filename of 8+3 chars.
    585          *   Eg. filename = "test.exe", strFileName = "test    exe"
    586          *
    587          * Argument:
    588          *       FileName             :[IN] Valid Filename.
    589          *       strFileName          :[OUT] filename padded, allocated by user to [8+3]
    590          *
    591          * Return value :
    592          *       returns First cluster of the file,
    593          *       or 0 if no matching file was found
    594          *****************************************************************/

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

   \                                 In segment CODE, align 4, keep-with-next
    645          int findEntry(char *fileName)
    646          {
   \                     findEntry:
   \   00000000   F0B5               PUSH        {R4-R7,LR}
   \   00000002   90B0               SUB         SP,#+64
    647            UCHAR *_flashDirEnt = NULL;             // Point to a directory entry DIR_Name
    648            UCHAR  pDirEnt[DIRECTORY_ENTRIE_SIZE];
    649            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]
    650            USHORT _currentEntry;
    651            USHORT _numberDirEntryPerCluster;
    652            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 

⌨️ 快捷键说明

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