函式名: intdosx
用 法: int intdosx(union REGS *inregs, union REGS *outregs,
struct SREGS *segregs)
基本介紹
- 中文名:intdosx
- 功 能:通用DOS中斷接口
- 類型:函式名
- 用 法:int intdosx(union REGS
定義,示例,
定義
函式名: intdosx
用 法: int intdosx(union REGS *inregs, union REGS *outregs,
struct SREGS *segregs);
示例
#include
#include
/* deletes file name; returns 0 on success, nonzero on failure */
int delete_file(char far *filename)
{
union REGS regs; struct SREGS sregs;
int ret;
regs.h.ah = 0x41; /* delete file */
regs.x.dx = FP_OFF(filename);
sregs.ds = FP_SEG(filename);
ret = intdosx(®s, ®s, &sregs);
/* if carry flag is set, there was an error */
return(regs.x.cflag ? 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;
}