home *** CD-ROM | disk | FTP | other *** search
- Program Test_My_Interrupts;
-
- {This program was designed to test the installation and operation of the
- interrupt driver OSIO.TPU. It requries Turbo Pascal 6.0 for operation
- Copyright <C> 1991, Ryan S. Dancey}
-
- USES CRT, DOS, OSIO;
-
- var
- SerialIO : Serial_IO; {The Serial Object}
- Garbage : Boolean; {Variable to hold open and close results}
- Ch, InCh : Char; {Character variables for I/O}
-
- begin
- ClrScr;
- with SerialIO do
- begin
- Garbage := Open_Port(2,300,8,1,'N'); {Open port at 300 baud, 8 bits, 1 stop bit, no parity}
- writeln(Garbage);
- repeat
- if KeyPressed then
- begin
- Ch := ReadKey;
- repeat until Send_Character(2,Ch);
- end;
- if Query_Buffer(2) then {If this value is greater than 1, than a character has been recevied}
- begin
- if Get_Character(2,InCh) then
- begin
- write(InCh);
- end;
- end;
- until Ch = chr(3);
- Garbage := Close_Port(2);
- writeln(Garbage);
- repeat until KeyPressed;
- Ch := ReadKey;
- end;
- end.