Since you're on Win98 with Turbo C, the following routine worked for me:
Code:
int GetSector()
{
int s, c, h, d;
union
{ char ch[0x10];
short sh[0x08];
long lg[0x04];
} extbuf;
if (Drive < 0) Drive= 0x80;
if (Sector< 0)
{
printf("No Sector specified\n");
return (-1);
}
reg.r_ax = 0x4200;
reg.r_dx = Drive;
reg.r_si = FP_OFF(extbuf.ch);
reg.r_ds = FP_SEG(extbuf.ch);
extbuf.ch[0] = 0x10;
extbuf.ch[1] = 0;
extbuf.sh[1] = 1;
extbuf.sh[2] = FP_OFF(getbuf);
extbuf.sh[3] = FP_SEG(getbuf);
extbuf.lg[2] = Sector;
extbuf.lg[3] = 0;
intr(0x13, ®);
if (reg.r_flags & CF)
{
printf("Error %02X \n", reg.r_ax);
return (1);
}
return (NO_ERROR);
}
Drive C: is 0x80, as defaulted above
Variables Drive and Sector are global.