Информационный сервер для программистов: Исходники со всего света. Паскальные исходники со всего света
  Powered by Поисковый сервер Яndex: Найдется ВСЁ!
На Главную Pascal Форум Информер Страны мира
   Коммуникация    >>    async4u
   
 
 Async4u - Communication Unit for TP4  Tom R.Donnelly 04.03.88

Модификация коммуникационной библиотеки ASYNC в виде модуля для TP4.
This is a faithful translation of the famous ASYNC.INC by Michael Quinlan into a Turbo 4.0 unit. No extra frills, no modification of types, nothing fancy.



5k 
 

{----------------------------------------------------------------} { ASYNC4U.PAS } { } { This is a faithful translation of the famous ASYNC.INC by } { Michael Quinlan into a Turbo 4.0 unit. No extra frills, } { no modification of types, nothing fancy. But with this code } { you should be able to delete your $I ASYNC.INC directive, } { add a USES ASYNC4U statement, and recompile your existing } { program. If you want to add support for more ports, other } { computers, or change to use the new data types, all good ideas,} { go right ahead. With this you don't have to. } { Scott Gurvey, November 29 1987 } { } { I have taken the liberty of modifying Scott's original } { translation to make use of some of TURBO 4's nicer features. } { To wit: The procedure that initializes this unit's variables } { has been moved to the startup initialization section of the } { unit, removing the need to call ASYNC_INIT. } { The unit now defines an ExitProc routine that will call } { ASYNC_CLOSE whenever a termination occurs. The procedure } { ASYNC_CLOSE may still be explicitly called. However, if an } { abnormal termination should occur, the system won't be left } { with interrupt handlers active. } { Tom R. Donnelly, March 4, 1988 } {----------------------------------------------------------------} { } { ASYNC.INC } { } { Async Communication Routines } { by Michael Quinlan } { with a bug fixed by Scott Herr } { made PCjr-compatible by W. M. Miller } { Highly dependant on the IBM PC and PC DOS 2.0 } { } { Moved Async_init into Unit Initialization Section } { Setup ExitProc to call Async_close, to reset ports and } { vectors } { based on the DUMBTERM program by CJ Dunford in the January } { 1984 issue of PC Tech Journal. } { } { Entry points: } { } { Async_Init (Moved to unit initialization) } { Performs initialization. } { } { Async_Open(Port, Baud : Integer; } { Parity : Char; } { WordSize, StpBits : Integer) : Boolean } { Sets up interrupt vector, initialies the COM port for } { processing, sets pointers to the buffer. } { Returns FALSE if COM port not installed. } { } { Async_Buffer_Check(var C : Char) : Boolean } { If a character is available, returns TRUE and moves the } { character from the buffer to the parameter } { Otherwise, returns FALSE } { } { Async_Send(C : Char) } { Transmits the character. } { } { Async_Send_String(S : LStr) } { Calls Async_Send to send each character of S. } { } { Async_Close } { Turn off the COM port interrupts. } { **MUST** BE CALLED BEFORE EXITING YOUR PROGRAM; otherwise } { you will see some really strange errors and have to re-boot} { (Note: The **MUST** restriction no longer applies. } { This unit will hook itself into the ExitProc chain to } { automatically close the com ports, if still open at) } { termination. } {----------------------------------------------------------------}