Name
bdos - Invokes a DOS system call
Syntax
#include <dos.h>
int bdos(dosfn, dosdx, dosal)
int dosfn;
unsigned int dosdx;
unsigned int dosal;
Description
The bdos function invokes the DOS system call specified by
dosfn after placing the values specified by dosdx and dosal
in the DX and AL registers, respectively. The bdos function
executes an INT 21H instruction to invoke the system call.
When the system call returns, bdos returns the contents of
the AX register.
The bdos function is intended to be used to invoke DOS
system calls that either do not take arguments or only take
arguments in the DX (DH, DL) and/or AL registers.
Do not use the bdos function to call interrupts that modify
the DS register. Instead use the intdosx or int86x function.
The intdosx and int86x functions load the DS and ES
registers from the segregs parameter and also store the DS
and ES registers into segregs after the function call.
Return Value
The bdos function returns the value of the AX register after
the system call has completed.
See Also
intdos(DOS), intdosx(DOS)
Notes
This call should not be used to invoke system calls that
indicate errors by setting the carry flag. Since C programs
do not have access to this flag, the status of the return
value cannot be determined. The intdos function should be
used in these cases.
Example
#include <dos.h>
main( ) {
char *buffer = "Enter file name:$";
/* Call 0x9 prints a string terminated by "$" */
/* AL is not needed, so 0 is used */
bdos(0x9,(unsigned)buffer,0); }
This example calls DOS function 0x9 (display string) to
display a prompt. The prompt is the string that buffer
points to. This example works correctly only in small- and
medium-model programs.
(printed 6/18/89)