home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-1.ZIP / GCOMM / _ASDTR.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-08-14  |  1.1 KB  |  43 lines

  1.         page    60,132
  2. ;
  3. ; The Greenleaf Comm Library
  4. ;
  5. ; Copyright (C) 1984-90 Greenleaf Software Inc.  All Rights Reserved.
  6. ;
  7.  
  8.         .xlist
  9.         include model.h
  10.         include prologue.h
  11.         include asiports.equ
  12.         .list
  13.  
  14.         pseg    _asdtr
  15.  
  16.  
  17. ;**<<  _ A S D T R  >>**
  18. ;
  19. ;  int _asdtr( ioaddress, ctrl )
  20. ;
  21. ;  Turn DTR explicitly ON or OFF.  Return previous condition.
  22. ;
  23.         cproc   _asdtr,,,,,<NOSI,NODI>
  24.         mov     dx,parm1_
  25.         add     dx,MCREG        ; address modem ctrl reg
  26.         cli
  27.         in      al,dx           ; read current value
  28.         KILL_TIME
  29.         push    ax              ; save value
  30.         and     al,not DTR      ; assume turning off
  31.         test    word ptr parm2_,1 ;check assumption
  32.         jz      setdtr          ;if turning off
  33.         or      al,DTR          ;assummed wrong
  34. setdtr: out     dx,al           ;set 8250
  35.         KILL_TIME
  36.         sti
  37.         pop     ax              ;get initial value back
  38.         and     ax,DTR          ;and return only DTR bit
  39.         cproce
  40.         endps
  41.         end
  42.  
  43.