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

📄 fat_file_system.asm

📁 ADI BF DSP的CF卡的读写源码
💻 ASM
字号:

/************************************************************************************************/
/*	The following routine reads the drive information, the boot sector, and the 1st root 		*/
/*	directory off the CF.																		*/
/*															  Last Modified 02-26-03.  H. Desai */
/************************************************************************************************/

.GLOBAL FAT_File_System;

.EXTERN Drive_Info;
.EXTERN Identify_Drive_Command;
//.EXTERN Init_CHS;
.EXTERN Boot_Sector;
.EXTERN Read_Sector_CF;
.EXTERN Get_BootSector_Info;
.EXTERN Calc_CHS;
.EXTERN Root_Directory;

.SECTION program;

FAT_File_System:
R5 = RETS;
/**TEST**/
R1 = 0x0101(Z);
R2 = 0x0000(Z);
R3 = 0X20A0(Z);
I0.H = 0xF003;
I0.L = 0x0000;
L0 = 0x0;
B0 = I0;
CALL Read_Sector_CF;

/**Drive Information**/
Read_Drive_Info:
I0.H = Drive_Info;
I0.L = Drive_Info;
L0 = 0x0;
B0 = I0;
CALL Identify_Drive_Command;

/**Initialize CHS Calc. Parameters**/
//CALL Init_CHS;

/**Read Boot Sector**/
Read_Boot_Sector:
R1 = 0x0101(Z);						//Sector Number | Sector Count
R2 = 0x0000(Z);						//Cylinder HI | Cylinder LO
R3 = 0X20A1(Z);						//Read Command | Head Number
I0.H = Boot_Sector;
I0.L = Boot_Sector;
L0 = 0x0;
B0 = I0;
CALL Read_Sector_CF;
nop;

/**Get Boot Sector Information**/
CALL Get_BootSector_Info;

/**Read Root Directory**/
Read_Root_Directory:
R0 = [P1+0xC];						//R0 = # of Hidden Sectors
R1 = [P1];							//R1 = Start of Root Directory
R0 = R0 + R1;						//R0 = Offset of Root Directory plus Hidden Sectors

CALL Calc_CHS;

I0.H = Root_Directory;
I0.L = Root_Directory;
L0 = 0x0;
B0 = I0;
Call Read_Sector_CF;
NOP;

RETS = R5;
RTS;

⌨️ 快捷键说明

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