CS609 Assignment No 03 Spring 2019 Solution & Discussion

Views: 2265

Replies to This Discussion

#include<bios>
#include<dos>
FILE *fp;
unsigned char buf[1024];
unsigned char st[60];
unsigned char headno[10];
unsigned char secno[10];
unsigned char trackno[10];
void main (void) {
int i ;
for (i=0;i<1024;i++)
buf[i]=0;
gets(st);
fp=fopen(st,"wb");
printf("Head ");
gets(headno);
puts (headno);
printf("\nsector ");
gets(secno);
puts(secno);
printf("\ntrack ");
gets(trackno);
puts(trackno);
i = biosdisk(2,0x80,atoi(headno), atoi(trackno),atoi(secno),2,buf) ;
if (*(((char *)(&i))+1)==0) {
fwrite(successfully file read);

}
else printf("Cannot Read Error# = %x",i);
}

Image may contain: text

Image may contain: text

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service