Where should be modfy?

This is a discussion on Where should be modfy? within the C Programming forums, part of the General Programming Boards category; I want to write "FF" to the sector of FD(all 512byte). Where should be modfy? mary #include <stdio.h> #include <dos.h> ...

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    11

    Where should be modfy?

    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, &regs, &regs, &sregs);

    printf("\n");
    for (i = 0 ; i <= 511; i ++){
    printf("%2X ",buffer[i]);
    }
    return(regs.x.cflag);
    }

  2. #2
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > Where should be modfy?
    Could you explain what it is you're looking for with a little bit more detail?
    The world is waiting. I must leave you now.

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    11

    Smile The problem was solved!

    The problem was solved!
    Thank you!!

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: The problem was solved!

    Originally posted by mary
    The problem was solved!
    Thank you!!
    err... you're welcome!
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    PHEW! Job well done!

    ????????????
    The world is waiting. I must leave you now.

  6. #6
    back? dbaryl's Avatar
    Join Date
    Oct 2001
    Posts
    597
    anybody thinks this should be added to the FAQ board?
    This is my signature. Remind me to change it.

  7. #7
    Registered User
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    212
    Yeah, should be added to the FAQ board. I rate this thread 5 stars

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21