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 - <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() invokes the DOS system call 'dosfn'. Before calling DOS,
    'dosdx' and 'dosal' are placed in the DX and AL registers,
    respectively, and DOS is then invoked via 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 other
                than the DX and AL registers.  Use intdosx() with
                programs that use large model data segments and need to
                set the DS or ES registers before the call.

  -------------------------------- 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