Borland C++ reference

bdos

raw OCR

Accesses DOS system calls.

Defined in header <dos.h>

Syntax

#include <dos.h>
int bdos(int dosfun, unsigned dosdx, unsigned dosal);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

bdos provides direct access to many of the DOS system calls. See your DOS reference manuals for details on each system call.

For system calls that require an integer argument, use bdos; if they require a pointer argument, use bdosptr. In the large data models (compact, large, and huge), it is important to use bdosptr instead of bdos for system calls that require a pointer as the call argument.

dosfun is defined in your DOS reference manuals.

dosdx is the value of register DX.

dosal is the value of register AL,

Return value

The return value of bdos is the value of AX set by the system call.

See also

Example

#include <stdio.h>
#include <dos.h>

/* get current drive as  'A', 'B', ... */
char current_drive(void)
{
   char curdrive;

   /* get current disk as  0, 1, ... */
   curdrive = bdos (0x19, 0, 0);
   return ('A' + curdrive);
}
int main (void)
{
   printfC'The current drive  is %c:\n", current_drive());
   return 0;
}

Program   output

The current drive is C:

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.