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

📄 getsec.c

📁 这是DOS系统的源代码,汇编写的,值得看看,对开发操作系统的人员有价值
💻 C
字号:
/***************************************************************************/
/*																									*/
/*	GETSECT.C																					*/
/*																									*/
/*		Copyright (c) 1991 - Microsoft Corp.											*/
/*		All rights reserved.																	*/
/*		Microsoft Confidential																*/
/*                                                                         */
/* Calculates the total sectors on a hard disk based on the values in a 	*/
/* hard disk parameters structure.														*/
/* 																								*/
/* UL GetTotalHdSectors( struct HdParms *Parms )									*/
/* 																								*/
/* ARGUMENTS:	Parms 			- Ptr to hard disk parameters structure		*/
/* RETURNS: 	unsigned long	- Total physical sectors on the hard disk		*/
/* 																								*/
/* NOTE: 																						*/
/* 		Need to remember that heads and cylinders begin with 0 and			*/
/* 		sectors begin with 1.															*/
/* 																								*/
/* Created 02-07-90 johnhe																	*/
/***************************************************************************/

#include		<alias.h>
#include 	<hdisk.h>


UL GetTotalHdSectors( struct HdParms *Parms )
{
	return( (UL)(Parms->MaxHead+1) *
			  (UL)(Parms->MaxSec) *
			  (UL)( Parms->MaxCyl+1) );
}


⌨️ 快捷键说明

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