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 / _ASISTAR.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-08-14  |  2.3 KB  |  80 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.  
  15.         pseg    _asistart
  16.  
  17. ;**<<  _ A S I S T A R T  >>**
  18. ;
  19. ;
  20. ;  int _asistart(p)
  21. ;  struct PORT_TABLE *p;
  22. ;
  23. ;  If mode is output or inout, the Tx Buffer is checked - if it is
  24. ;  not empty, the character pointed to by the PO pointer is output
  25. ;  to the port to start the transmit process.  Once started, successive
  26. ;  characters will be output under control of the interrupt process itself.
  27. ;
  28. ;  At the same time, the interrupt modes are started.  Tx, Rx, or both are
  29. ;  enabled.  This starts the Rx process and allows incoming characters to be
  30. ;  assembled.
  31. ;
  32. ;  Modifications:
  33. ;    ""   12-MAY-1988  11:44:55.48
  34. ;      Modified to use alternate method of controlling transmit interrupts.
  35. ;
  36.         cproc   _asistart,,_asistar,,,<NODI,DS>
  37.         if      _LDATA
  38.          lds    si,parm1_
  39.         else
  40.          mov    si,parm1_
  41.         endif
  42.         mov     cx,[si+base_8250]       ;base address to DX
  43.         mov     dx,LCREG
  44.         add     dx,cx
  45.         in      al,dx
  46.         KILL_TIME
  47.         and     al,not DLAB
  48.         out     dx,al
  49.         KILL_TIME
  50.         mov     dx,cx
  51.         in      al,dx           ; get char and ignore it
  52.         KILL_TIME
  53.         mov     al,ENRXS+ENMS   ; enable Rx special & Modem Status
  54. txdisa: test    [si+chmode_bits],IS_RXINT       ;see if receive enabled
  55.         jz      rxdisa
  56.         or      al,ENRX
  57.         or      [si+chst_bits],RCHRUN           ;say receive running
  58. rxdisa:
  59.         test   [si+chmode_bits],IS_TXINT       ;see if transmit enabled
  60.         jz     xtxdisa                         ;if not skip it
  61.         or     al,ENTX
  62. xtxdisa:
  63.         mov     dx,INTER
  64.         add     dx,cx           ;dx=interrupt enable register
  65.         out     dx,al
  66.         KILL_TIME
  67.         mov     dx,MCREG
  68.         add     dx,cx           ;dx = Modem control register
  69.         in      al,dx           ; get whatever is there
  70.         KILL_TIME
  71.         or      al,OUT2         ; turn on OUT2
  72.         out     dx,al
  73.         KILL_TIME
  74.         xor     ax,ax
  75.         cproce
  76.         endps
  77.         end
  78.  
  79.  
  80.