| C语言库函数(B类字母) |
|
| 作者:未知 文章来源:网络收集 点击数: 更新时间:2006-3-29 15:22:23
|
\n"); while (!DONE) { status = bioscom(3, 0, COM1); if (status & DATA_READY) if ((out = bioscom(2, 0, COM1) & 0x7F) != 0) putch(out); if (kbhit()) { if ((in = getch()) == '\x1B') DONE = TRUE; bioscom(1, in, COM1); } } return 0; }
函数名: biosdisk 功 能: 软硬盘I/O 用 法: int biosdisk(int cmd, int drive, int head, int track, int sector int nsects, void *buffer); 程序例:
#include #include
int main(void) { int result; char buffer[512];
printf("Testing to see if drive a: is ready\n"); result = biosdisk(4,0,0,0,0,1,buffer); result &= 0x02; (result) ? (printf("Drive A: Ready\n")) : (printf("Drive A: Not Ready\n"));
return 0; }
函数名: biosequip 功 能: 检查设备 用 法: int biosequip(void); 程序例:
#include #include
int main(void) { int result; char buffer[512];
printf("Testing to see if drive a: is ready\n"); result = biosdisk(4,0,0,0,0,1,buffer); result &= 0x02; (result) ? (printf("Drive A: Ready\n")) : (printf("Drive A: Not Ready\n"));
return 0; }
函数名: bioskey 功 能: 直接使用BIOS服务的键盘接口 用 法: int bioskey(int cmd); 程序例:
#include #include #include
#define RIGHT 0x01 #define LEFT 0x02 #define CTRL 0x04 #define ALT 0x08
int main(void) { int key, modifiers;
/* function 1 returns 0 until a key is pressed */ while (bioskey(1) == 0);
/* function 0 returns the key that is waiting */ key = bioskey(0);
/* use function 2 to determine if shift keys were used */ modifiers = bioskey(2); if (modifiers) { printf("["); if (modifiers & RIGHT) printf("RIGHT"); if (modifiers & LEFT) printf("LEFT"); if (modi上一页 [1] [2] [3] [4] [5] [6] 下一页
|
|
[ 收藏此页到: 天天|和讯|博采|ViVi|狐摘|我摘|天极 ] 文章录入:kinda 责任编辑:kinda |
|
上一篇文章: C语言库函数(A类字母) 下一篇文章: C语言库函数(C类字母) |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |