home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC1.ZIP / BDOSPTR.CAS < prev    next >
Encoding:
Text File  |  1992-06-10  |  1.3 KB  |  52 lines

  1. /*---------------------------------------------------------------------------
  2.  * filename - bdosptr.cas
  3.  *
  4.  * function(s)
  5.  *        bdosptr - MS-DOS system call
  6.  *--------------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #pragma  inline
  18. #include <dos.h>
  19. #include <asmrules.h>
  20. #include <_io.h>
  21.  
  22. /*--------------------------------------------------------------------------*
  23.  
  24. Name            bdosptr - MS-DOS system call
  25.  
  26. Usage           int bdosptr(int dosfun, void *argument, unsigned dosal);
  27.  
  28. Prototype in    dos.h
  29.  
  30. Description     provides direct access to the MS-DOS system calls which
  31.                 require a pointer argument.
  32.  
  33. Return value    the return value of AX on success, or -1 on failure; errno
  34.                 and _doserrno are also set on failure.
  35.  
  36. *---------------------------------------------------------------------------*/
  37. int _CType bdosptr(int cmd, void *arg, unsigned dosal)
  38. {
  39.         pushDS_
  40. asm     mov     ah, byte ptr cmd
  41. asm     mov     al, byte ptr dosal
  42. asm     LDS_    dx, arg
  43. asm     clc
  44. asm     int     21h
  45.         popDS_
  46. asm     jc      bdosptrFailed
  47.         return(_AX);
  48.  
  49. bdosptrFailed:
  50.         return __IOerror(_AX);
  51. }
  52.