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 / _ASRTS.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-08-14  |  1.6 KB  |  60 lines

  1.         page    60,132
  2.  
  3. ;
  4. ; The Greenleaf Comm Library
  5. ;
  6. ; Copyright (C) 1984-90 Greenleaf Software Inc.  All Rights Reserved.
  7. ;
  8.  
  9.         .xlist
  10.         include model.h
  11.         include prologue.h
  12.         include asiports.equ
  13.         .list
  14.  
  15.         pseg    _asrts
  16.  
  17. ;**<<  _ A S R T S  >>**
  18. ;
  19. ;  int _asrts( ioaddress, ON/OFF,p )
  20. ;
  21. ;  Explicitly turn RTS on or off.  Call from asrts.
  22. ;
  23. ;  MODIFICATIONS
  24. ;  ""   20-FEB-1987  10:53:02.51
  25. ;       Modified to update RTSACTIVE bit in structure.
  26. ;
  27.         cproc   _asrts,,,,,<NOSI,NODI>
  28.         mov     dx,parm1_
  29.         add     dx,MCREG        ; address modem ctrl reg
  30.         if      _LDATA
  31.          push   ds
  32.          lds    bx,parm3_
  33.         else
  34.          mov    bx,parm3_
  35.         endif
  36.         cli
  37.         in      al,dx           ; read current value
  38.         KILL_TIME
  39.         push    ax              ; save previous value on stack
  40.         and     al,not RTS      ; assume turning off
  41.         test    word ptr parm2_,1 ;check assumption
  42.         jz      resrts          ;if turning off
  43.         or      al,RTS          ;assummed wrong
  44.         or      word ptr [bx+chst_bits],RTSACTIVE       ;set bit in structure
  45.         jmp     short setrts
  46. resrts: and     word ptr [bx+chst_bits],not RTSACTIVE   ;reset bit
  47. setrts: out     dx,al           ;set 8250
  48.         KILL_TIME
  49.         sti
  50.         pop     ax
  51.         shr     al,1            ;shift RTS to bit 0
  52.         and     ax,1            ;and return it's previous value
  53.         if      _LDATA
  54.          pop    ds
  55.         endif
  56.         cproce
  57.  
  58.         endps
  59.         end
  60.