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

📄 fat16.lst

📁 基于MCU的U盘源码
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.09   FAT16                                                                 05/11/2005 17:30:28 PAGE 1   


C51 COMPILER V7.09, COMPILATION OF MODULE FAT16
OBJECT MODULE PLACED IN fat16.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE fat16.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          /////////////////////////////////////////////////////////////////
   2          //
   3          // Copyright (c) 2004 
   4          // All rights reserved
   5          // 
   6          // Author       :       frank_wang     frank_wang@263.net
   7          // Created      :       JUN 23th 2004
   8          // Modified     :
   9          // Revision     :       ARM7+D12,
  10          // Usage        :        USB DISK ,SCSI-2
  11          /////////////////////////////////////////////////////////////////
  12          
  13          //#include "def.h"
  14          
  15          #include "Fat16.h"
*** ERROR C129 IN LINE 40 OF FAT16.H: missing ';' before 'struct'
  16          #include "Flash.h"
*** WARNING C318 IN LINE 1 OF Flash.h: can't open file '..\inc\44b.h'
*** WARNING C318 IN LINE 2 OF Flash.h: can't open file '..\inc\def.h'
  17          //数据结构与全局变量定义
  18          
  19          U8 BPB_Data[512]=
  20          {
  21          0xeb,0x3c,0x90,//       Offset_U8_BS_jmpBoot            0
  22          'F','r','a','n','k','w','x','j',// Offset_U8_BS_OEMName         3
  23          0x00,0x02,// Offset_U16_BPB_BytsPerSec  11      //Count of bytes per sector. This value may take on only the  //
  24          //512                                                                   //following values: 512, 1024, 2048 or 4096. If maximum       //
  25                                                                                          //compatibility is desired, only the value 512 should be used.//
  26          64,// Offset_U8_BPB_SecPerClus  13      //Number of sectors per allocation unit. This value must be a //
  27                                                                                          //power of 2 that is greater than 0. The legal values are 1,  //
  28                                                                                          //      2, 4, 8, 16, 32, 64,and 128.                                //
  29          0x1,0x00,// Offset_U16_BPB_RsvdSecCnt   14      //Number of reserved sectors in the Reserved region of the    //
  30                                                                                          //volume starting at the first sector of the volume.For FAT32 //
  31                                                                                          //volumes, this value is typically 32.                        //
  32          0x02,// Offset_U8_BPB_NumFATs           16      //The count of FAT data structures on the volume.             //
  33          0xb0,0x03,// Offset_U16_BPB_RootEntCnt  17      //Is only useful for FAT12 and FAT16 volumes.                 //
  34          //                                                                              //For FAT32 volumes,this field must be set to 0.              //
  35          //通过调整文件项为03b0,从而使数据扇区刚好从Block2Sector0开始,但
  36          //文件分区表中根目录区并为标记为已占用。数据实际从Block4Sector0开始
  37          0xea,0x7f,// Offset_U16_BPB_TotSec16            19      //For FAT12 and FAT16 volumes, this field contains the sector //
  38                                                                                          //count, and BPB_TotSec32 is 0 if the total sector count fits //
  39                                                                                          //(is less than 0x10000).                                     //
  40          0xf8,// Offset_U8_BPB_Media                     21      //0xF8 is the standard value for fixed(non-removable) media.  //
  41                                                                                          //For removable media, 0xF0 is frequently used.               //
  42          0x02,0x00,// Offset_U16_BPB_FATSz16             22      //This field is FAT12/FAT16 16bit count of sectors occupied by//
  43                                                                                          //      1 FAT.On FAT32 volumes this field must be 0, and BPB_FATSz32//
  44                                                                                          //contains the FAT size count.                                //
  45          0x00,0x00,// Offset_U16_BPB_SecPerTrk   24      //Sectors per track for interrupt 0x13. This field is only    //
  46                                                                                          //relevant for media that have a geometry (volume is broken   //
  47                                                                                          //down into tracks by multiple heads and cylinders) and are   //
  48                                                                                          //visible on interrupt 0x13.This field contains the           //
  49                                                                                          //"sectors per track" geometry value.                         //
  50          0x00,0x00,// Offset_U16_BPB_NumHeads            26      //Number of heads for interrupt 0x13. This field is relevant  //
  51                                                                                          //as discussed earlier for BPB_SecPerTrk.                     //
  52          0x01,0x00,0x00,0x00,// Offset_U32_BPB_HiddSec           28      //Count of hidden sectors preceding the partition that  
C51 COMPILER V7.09   FAT16                                                                 05/11/2005 17:30:28 PAGE 2   

             -      //
  53                                                                                          //contains this FAT volume.                                   //
  54          0x00,0x00,0x00,0x00,// Offset_U32_BPB_TotSec32          32      //This field is the new 32-bit total count of sectors o
             -n the  //
  55                                                                                          //volume. This count includes the count of all sectors in all //
  56                                                                                          //four regions of the volume. This field can be 0; if it is 0,//
  57                                                                                          //then BPB_TotSec16 must be non-zero. For FAT32 volumes, this //
  58                                                                                          //field must be non-zero. For FAT12/FAT16 volumes, this field //
  59                                                                                          //contains the sector count if BPB_TotSec16 is 0 (count is    //
  60                                                                                          //greater than or equal to 0x10000).//
  61          0x00,// Offset_U8_BS_DrvNum             36      //This field is the FAT32 32-bit count of sectors occupied by //
  62                  //根据该值得到FAT的大小//                               //ONE FAT. BPB_FATSz16 must be 0.                             //
  63                  
  64          0x00,// Offset_U8_BS_Reserved           37      //    Bits 0-3 -- Zero-based number of active FAT.Only valid  //
  65                                                                                          //                if mirroring is disabled.                   //
  66                                                                                          //    Bits 4-6 -- Reserved.                                   //
  67                                                                                          //    Bit 7    -- 0 means the FAT is mirrored at runtime into //
  68                                                                                          //                  all FATs.                                 //
  69                                                                                          //             -- 1 means only one FAT is active;it is the one//
  70                                                                                          //                  referenced in bits 0-3.                   //
  71                                                                                          //    Bits 8-15 -- Reserved.                                  //
  72          0x29,// Offset_U8_BS_BootSig            38      //High byte is major revision number.                         //
  73                                                                                          //Low byte is minor revision number.                          //
  74          'N','A','M','E',// Offset_U32_BS_VolID          39      //This is set to the cluster number of the first cluster of   /
             -/
  75                  //根据该值得到ROOT的地址//                              //the root directory, usually 2 but not required to be 2.     //
  76                  
  77          'N','O',' ','N','A','M','E',' ',' ',' ',' ',// Offset_U2048_BS_VolLab           43      //Sector number of FSINFO struct
             -ure in the reserved area of   //
  78                                                                                          //the FAT32 volume.Usually 1.                                 //
  79          'F','A','T','1','6',' ',' ',' ',// Offset_U256_BS_FilSysType    54      //If non-zero, indicates the sector number
             - in the reserved    //
  80                                                                                          //area of the volume of a copy of the boot record.            //
  81          //Executable Code
  82          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  83          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  84          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  85          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  86          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  87          
  88          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  89          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  90          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  91          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,      
  92          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,
  93          
  94          0x00,//active partion
  95          0x00,//head
  96          0x00,//partion begin
  97          0x00,//cylinder
  98          0x06,//is partion used
  99          0x00,//end head
 100          0x00,//partion end 
 101          0x00,//end cylinder
 102          0x00,0x00,0x00,0x00,
 103          0x00,0x80,0x00,0x00,//fist partion
 104          
 105          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,//second partion
 106          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,//third partion
 107          0,0,0,0,0,              0,0,0,0,0,              0,0,0,0,0,              0,//forth partion
 108          
 109          0x55,0xAA       // Offset_U16_Signature         510     //0x55AA           

⌨️ 快捷键说明

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