中秋节主题的画:什么是BDOS

来源:百度文库 编辑:高校问答 时间:2024/05/14 19:13:26

函数名: bdos
功 能: DOS系统调用
用 法: int bdos(int dosfun, unsigned dosdx, unsigned dosal);
程序例:

#include <stdio.h>
#include <dos.h>

/* Get current drive as 'A', 'B', ... */
char current_drive(void)
{
char curdrive;

/* Get current disk as 0, 1, ... */
curdrive = bdos(0x19, 0, 0);
return('A' + curdrive);
}

int main(void)
{
printf("The current drive is %c:\n", current_drive());
return 0;
}