Borland C++ reference

bdosptr

raw OCR

Accesses DOS system calls.

Defined in header <dos.h>

Syntax

#include <dos.h>
int bdosptr(int dosfun, void *argument, unsigned dosal);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

bdosptr provides direct access to many of the DOS system calls. See your DOS reference manuals for details of 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 for system calls that require a pointer as the call argument. In the small data models, the argument parameter to bdosptr specifies DX; in the large data models, it gives the DS:DX values to be used by the system call.

dosfun is defined in your DOS reference manuals.

dosal is the value of register AL.

Return value

The return value of bdosptr is the value of AX on success or -1 on failure. On failure, the global variables errno and _doserrno are set.

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(0xl9, 0, 0);
   return('A' + curdrive);
}
int main(void)
{
   printfC'The current drive is %c:\n", current_drive ());
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.