c语⾔putpixel函数普通写法,C语⾔标准函数库5函数名: int86x
功
能: 通⽤8086软中断接⼝
⽤
法: int int86x(int intr_num,
union REGS *insegs, union
REGS *outregs,
struct SREGS *segregs);
程序例:
#include
#include
#include
int main(void)
{
char filename[80];
union REGS inregs,
outregs;
struct SREGS segregs;
printf("Enter filename:
");
gets(filename);
inregs.h.ah = 0x43;
inregs.h.al = 0x21;
FP_OFF(filename);
segregs.ds =
FP_SEG(filename);
int86x(0x21, &inregs,
&outregs, &segregs);
printf("File attribute: %X\n",
<);
return 0;
}
函数名: intdos
功
能: 通⽤DOS接⼝
⽤
法: int intdos(union REGS
*inregs, union REGS *outregs); 159
程序例:
#include
#include
int delete_file(char near
*filename)
{
union REGS regs;
int ret;
regs.h.ah = 0x41;
ret = intdos(®s,
®s);
flag ? ret :
0);
}
int main(void)
{
int err;
err =
delete_file("NOTEXIST.$$$");
if (!err)
printf("Able to delete NOTEXIST.$$$\n");
else
printf("Not Able to delete NOTEXIST.$$$\n");
return 0;
}
函数名: intdosx
功
能: 通⽤DOS中断接⼝
⽤
法: int intdosx(union REGS
*inregs, union REGS *outregs, struct SREGS *segregs);
程序例:
#include
#include
int delete_file(char far
*filename)
{
union REGS regs;
struct SREGS sregs;
int ret;
regs.h.ah = 0x41;
FP_OFF(filename);
sregs.ds =
FP_SEG(filename);
ret = intdosx(®s,
®s, &sregs);
flag ? ret :
0);
}
int main(void)
{
int err;
err =
delete_file("NOTEXIST.$$$");
if (!err)
printf("Able to delete
NOTEXIST.$$$\n");
else
printf("Not Able to delete NOTEXIST.$$$\n");
return 0;
}
函数名: intr
功
能: 改变软中断接⼝
⽤
法: void intr(int intr_num,
struct REGPACK *preg);
程序例:
#include
#include
#include
#include
#define CF 1
int main(void)
161
{
char directory[80];
struct REGPACK reg;
printf("Enter directory to change to: ");
gets(directory);
reg.r_ax = 0x3B
<< 8;
reg.r_dx =
FP_OFF(directory);
reg.r_ds =
FP_SEG(directory);
intr(0x21, ®);
if (reg.r_flags &
CF)
printf("Directory change
failed\n");
c语言库函数
getcwd(directory, 80);
printf("The current directory is: %s\n", directory);
return 0;
}
函数名: ioctl
功
能: 控制I/O设备
⽤
法: int ioctl(int handle, int
cmd[,int *argdx, int argcx]);
程序例:
#include
#include
#include
int main(void)
{
int stat;
stat = ioctl(0, 8, 0, 0);
if (!stat)
printf("Drive %c is removable.\n", getdisk() + 'A');
else
printf("Drive %c is not removable.\n", getdisk() + 'A'); return 0;
}
162
函数名: isatty
功
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论