home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / tvision / dpmi / clib / dosext.cpp next >
Encoding:
C/C++ Source or Header  |  1994-05-29  |  1.4 KB  |  79 lines

  1. #include <stdio.h>
  2.  
  3. #include "dpmish.h"
  4. #include "dosext.h"
  5.  
  6.  
  7. int DosExtender::installIntHandler(
  8.     int intNr,
  9.     DpmiInterruptVector func,
  10.     unsigned& handle)
  11. {
  12.     unsigned temp;
  13.     asm {
  14.         mov ax, EXAPI_INSTALL
  15.         mov bx, intNr
  16.         mov cx, word ptr func+2
  17.         mov dx, word ptr func
  18.         int _EXTENDER_VECT
  19.         mov temp, bx
  20.     }
  21.     handle = temp;
  22.     return _AX;
  23. }
  24.  
  25.  
  26. void DosExtender::removeIntHandler( unsigned handle )
  27. {
  28.     asm {
  29.         mov ax, EXAPI_REMOVE
  30.         mov bx, handle
  31.         int _EXTENDER_VECT
  32.     }
  33. }
  34.  
  35. void DosExtender::initComm(int port, int baud, int flags)
  36. {
  37.     asm {
  38.         mov ax, EXAPI_INITCOMM
  39.         mov bx, port
  40.         mov cx, baud
  41.         mov dx, flags
  42.         int _EXTENDER_VECT
  43.     }
  44. }
  45.  
  46. void DosExtender::termComm(int port)
  47. {
  48.     asm {
  49.         mov ax, EXAPI_TERMCOMM
  50.         mov bx, port
  51.         int _EXTENDER_VECT
  52.     }
  53. }
  54.  
  55. void DosExtender::readComm(int port, CommRequest far *req)
  56. {
  57.     asm {
  58.         mov ax, EXAPI_READCOMM
  59.         mov bx, port
  60.         mov cx, word ptr req+2
  61.         mov dx, word ptr req
  62.         int _EXTENDER_VECT
  63.     }
  64. }
  65.  
  66.  
  67. void DosExtender::writeComm(int port , CommRequest far *req)
  68. {
  69.     asm {
  70.         mov ax, EXAPI_WRITECOMM
  71.         mov bx, port
  72.         mov cx, word ptr req+2
  73.         mov dx, word ptr req
  74.         int _EXTENDER_VECT
  75.     }
  76. }
  77.  
  78.  
  79.