『楼 主』:
Djgpp 里无法调用中断 int13 ah=48h 苦恼~!
Djgpp 里无法调用中断 int13 ah=48h 苦恼~!
//#define _BORLAND_DOS_REGS
#include <dos.h>
#include <math.h>
#include <stdio.h>
#include <sys/segments.h>
#include <go32.h>
#include <sys/movedata.h>
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
int main()
{
union REGS regs;
struct SREGS sregs;
struct{
WORD size;
WORD inforflags;
DWORD cylns;
DWORD heads;
DWORD sects;
DWORD tslow;
DWORD tshi;
WORD bps;
}package;
regs.h.ah=0x48;
regs.h.dl=0x80;
//--- TC ---// TC用下面这两行传入段地址和偏移量就没有问题
//sregs.ds = FP_SEG(&package);
//regs.x.si = FP_OFF(&package);
//--- DJGPP ---// 可在DJGPP里我就不知道怎么输入这个量了~!
sregs.ds = _my_ds();
regs.x.si = _my_ds();
printf("ds=%x si=%x \n",sregs.ds,regs.x.si);
printf("package= %x \n",&package);
int386x(0x13,®s,®s,&sregs);
printf("%d \n",regs.h.ah);
printf("cyliners = %ld\n",package.cylns);
printf("heads = %ld \n",package.heads);
printf("sect/cyln = %ld \n",package.sects);
printf("Lsectors = %ld\n",package.tslow);
printf("Hsectors = %ld\n",package.tshi);
printf("bytes = %ld\n",package.bps);
printf("gb = %.f GB\n",(double)(package.tslow*512.0/pow(10,9)));
printf("-------------------------- \n \n \n");
}
高手显身吧~!快救救我~!
|