📄 format.lst
字号:
C51 COMPILER V7.50 FORMAT 02/08/2007 11:18:10 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE FORMAT
OBJECT MODULE PLACED IN FORMAT.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE FORMAT.C LARGE BROWSE DEBUG OBJECTEXTEND
line level source
1
2 #include "REGSND1.H"
3 #include "USBDEF.H"
4 #define Root_Cluster (0) //MBR所在的簇号
5 #define Data_Cluster (1) //数据真正开始的扇区
6
7 #define BPB_Sector (0)
8 #define Fat_Sector (BPB_Sector + 1)
9 #define Directory_Sector (Fat_Sector + 4)
10 unsigned char Page_Buf1[512];
11 extern void delay();
12 extern void Flash_Reset(void);
13 extern void ReadPage(unsigned int block, unsigned int page, unsigned char *pPage);
14 code unsigned char BPB_Data[512] = {
15 0xeb, 0x3c, 0x90,// Offset_U8_BS_jmpBoot 0
16 'L', 'u', 'q', 'I', 'H', 'u', 'a', 'j',// Offset_U8_BS_OEMName 3
17 0x00, 0x02,// Offset_short int_BPB_BytsPerSec 11 //Count of bytes per sector. This value may take on on
-ly the //
18 //512 //following values: 512, 1024, 2048 or 4096. If maximum //
19 //compatibility is desired, only the value 512 should be used.//
20 64,// Offset_U8_BPB_SecPerClus 13 //Number of sectors per allocation unit. This value must be a //
21 //power of 2 that is greater than 0. The legal values are 1, //
22 // 2, 4, 8, 16, 32, 64,and 128. //
23 0x1, 0x00,// Offset_short int_BPB_RsvdSecCnt 14 //Number of reserved sectors in the Reserved region of
-the //
24 //volume starting at the first sector of the volume.For FAT32 //
25 //volumes, this value is typically 32. //
26 0x02,// Offset_U8_BPB_NumFATs 16 //The count of FAT data structures on the volume. //
27 0x02, 0x00,//0xb0, 0x03,// Offset_short int_BPB_RootEntCnt 17 //Is only useful for FAT12 and FAT16 volu
-mes. //
28 // //For FAT32 volumes,this field must be set to 0. //
29 //通过调整文件项为03b0,从而使数据扇区刚好从Block2Sector0开始,但
30 //文件分区表中根目录区并为标记为已占用。数据实际从Block4Sector0开始
31 0xff, 0x3f, //0xea, 0x7f, //Offset_short int_BPB_TotSec16 19 //For FAT12 and FAT16 volumes, this field
- contains the sector //
32 //count, and BPB_TotSec32 is 0 if the total sector count fits //
33 //(is less than 0x10000). //
34 0xf8,// Offset_U8_BPB_Media 21 //0xF8 is the standard value for fixed(non-removable) media. //
35 //For removable media, 0xF0 is frequently used. //
36 0x02, 0x00,// Offset_short int_BPB_FATSz16 22 //This field is FAT12/FAT16 16bit count of sectors occup
-ied by//
37 // 1 FAT.On FAT32 volumes this field must be 0, and BPB_FATSz32//
38 //contains the FAT size count. //
39 0x00, 0x00,// Offset_short int_BPB_SecPerTrk 24 //Sectors per track for interrupt 0x13. This field is o
-nly //
40 //relevant for media that have a geometry (volume is broken //
41 //down into tracks by multiple heads and cylinders) and are //
42 //visible on interrupt 0x13.This field contains the //
43 //"sectors per track" geometry value. //
44 0x00, 0x00,// Offset_short int_BPB_NumHeads 26 //Number of heads for interrupt 0x13. This field is rel
-evant //
45 //as discussed earlier for BPB_SecPerTrk. //
46 0x01, 0x00, 0x00, 0x00,// Offset_U32_BPB_HiddSec 28 //Count of hidden sectors preceding the partition
-that //
47 //contains this FAT volume. //
C51 COMPILER V7.50 FORMAT 02/08/2007 11:18:10 PAGE 2
48 0x00, 0x00, 0x00, 0x00,// Offset_U32_BPB_TotSec32 32 //This field is the new 32-bit total count of sec
-tors on the //
49 //volume. This count includes the count of all sectors in all //
50 //four regions of the volume. This field can be 0; if it is 0,//
51 //then BPB_TotSec16 must be non-zero. For FAT32 volumes, this //
52 //field must be non-zero. For FAT12/FAT16 volumes, this field //
53 //contains the sector count if BPB_TotSec16 is 0 (count is //
54 //greater than or equal to 0x10000).//
55 0x00,// Offset_U8_BS_DrvNum 36 //This field is the FAT32 32-bit count of sectors occupied by //
56 //根据该值得到FAT的大小// //ONE FAT. BPB_FATSz16 must be 0. //
57
58 0x00,// Offset_U8_BS_Reserved 37 // Bits 0-3 -- Zero-based number of active FAT.Only valid //
59 // if mirroring is disabled. //
60 // Bits 4-6 -- Reserved. //
61 // Bit 7 -- 0 means the FAT is mirrored at runtime into //
62 // all FATs. //
63 // -- 1 means only one FAT is active;it is the one//
64 // referenced in bits 0-3. //
65 // Bits 8-15 -- Reserved. //
66 0x29,// Offset_U8_BS_BootSig 38 //High byte is major revision number. //
67 //Low byte is minor revision number. //
68 'N', 'A', 'M', 'E',// Offset_U32_BS_VolID 39 //This is set to the cluster number of the first cluster
-of //
69 //根据该值得到ROOT的地址// //the root directory, usually 2 but not required to be 2. //
70
71 'N', 'O', ' ', 'N', 'A', 'M', 'E', ' ', ' ', ' ', ' ',// Offset_U2048_BS_VolLab 43 //Sector number of
-FSINFO structure in the reserved area of //
72 //the FAT32 volume.Usually 1. //
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -