Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>bdos() invoke ms-dos function, short form</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 bdos()                  Invoke MS-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 the call, 'dosdx'
    and 'dosal' are placed in the DX and AL registers, respectively; 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 either set the
                    carry flag on error, or that require registers other
                    than DX and AL to be set.  Use intdosx() with
                    programs that use large model data segments and need
                    to set the DS or ES registers before the call.

   Portability:     MS-DOS only.

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

    The following statements set the default drive to C: and record the
    number of logical drives supported by the system, the count of drives
    allowed by the "lastdrive" command in config.sys:

           #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;   /*  only need AL */
           }


See Also: intdos() intdosx() bdosptr()

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