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 */
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster