I want to write "FF" to the sector of FD(all 512byte).
Where should be modfy?
mary
#include <stdio.h>
#include <dos.h>
#define byte unsigned char
byte buffer[512];
int main()
{
int i;
union REGS regs;
struct SREGS sregs;
unsigned char far *p;
p = (unsigned char far *)buffer;
regs.h.ah = 03; //write disk int03h
regs.h.al = 01;
regs.h.ch = 00;
regs.h.cl = 01;
regs.h.dh = 00;
regs.h.dl = 00;
regs.x.bx = FP_OFF(p);
sregs.es = FP_SEG(p);
int86x(0x13, ®s, ®s, &sregs);
printf("\n");
for (i = 0 ; i <= 511; i ++){
printf("%2X ",buffer[i]);
}
return(regs.x.cflag);
}



LinkBack URL
About LinkBacks



