home *** CD-ROM | disk | FTP | other *** search
- page 60,132
- ;
- ; The Greenleaf Comm Library
- ;
- ; Copyright (C) 1984-90 Greenleaf Software Inc. All Rights Reserved.
- ;
-
- .xlist
- include model.h
- include prologue.h
- include asiports.equ
- .list
-
-
- pseg _asistart
-
- ;**<< _ A S I S T A R T >>**
- ;
- ;
- ; int _asistart(p)
- ; struct PORT_TABLE *p;
- ;
- ; If mode is output or inout, the Tx Buffer is checked - if it is
- ; not empty, the character pointed to by the PO pointer is output
- ; to the port to start the transmit process. Once started, successive
- ; characters will be output under control of the interrupt process itself.
- ;
- ; At the same time, the interrupt modes are started. Tx, Rx, or both are
- ; enabled. This starts the Rx process and allows incoming characters to be
- ; assembled.
- ;
- ; Modifications:
- ; "" 12-MAY-1988 11:44:55.48
- ; Modified to use alternate method of controlling transmit interrupts.
- ;
- cproc _asistart,,_asistar,,,<NODI,DS>
- if _LDATA
- lds si,parm1_
- else
- mov si,parm1_
- endif
- mov cx,[si+base_8250] ;base address to DX
- mov dx,LCREG
- add dx,cx
- in al,dx
- KILL_TIME
- and al,not DLAB
- out dx,al
- KILL_TIME
- mov dx,cx
- in al,dx ; get char and ignore it
- KILL_TIME
- mov al,ENRXS+ENMS ; enable Rx special & Modem Status
- txdisa: test [si+chmode_bits],IS_RXINT ;see if receive enabled
- jz rxdisa
- or al,ENRX
- or [si+chst_bits],RCHRUN ;say receive running
- rxdisa:
- test [si+chmode_bits],IS_TXINT ;see if transmit enabled
- jz xtxdisa ;if not skip it
- or al,ENTX
- xtxdisa:
- mov dx,INTER
- add dx,cx ;dx=interrupt enable register
- out dx,al
- KILL_TIME
- mov dx,MCREG
- add dx,cx ;dx = Modem control register
- in al,dx ; get whatever is there
- KILL_TIME
- or al,OUT2 ; turn on OUT2
- out dx,al
- KILL_TIME
- xor ax,ax
- cproce
- endps
- end
-
-