Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>bdos() invoke dos function, short form</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 bdos()                  Invoke DOS Function, Short Form

 #include <dos.h>

 int           bdos(dosfn,dosdx,dosal);
 int           dosfn;                    DOS function number
 unsigned int  dosdx;                    DX register value
 unsigned int  dosal;                    AL register value

    bdos() places 'dosdx' in the DX register and 'dosal' in the AL
    register and then invokes the DOS system call 'dosfn' by executing an
    Interrupt 21h.

    Returns:    The value of the AX register after the system call.

      Notes:    Use intdos() for system calls that indicate errors by
                setting the carry flag, or that require setting registers
                other than DX and AL.  Use intdosx() with programs that
                use large multiple data segments and need to set the DS
                or ES registers before the call.

 Portability:  Applies to MS-DOS only.

   ------------------------------ Example -------------------------------

    The following statements set the default drive to C: and record the
    number of logical drives in the system:

           #include <dos.h>       /* Required for function definition only */

           int num_drives;

           main()
           {
           /* dosdx = drive number;  dosal is not used */
           num_drives = bdos(0xE,2,0) & 0xFF; /* mask off AH, only need AL */
           }


See Also: intdos() intdosx()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson