-
Notifications
You must be signed in to change notification settings - Fork 0
/
testprco.pas
46 lines (44 loc) · 1.26 KB
/
testprco.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ +--------------------------------------------------------------------------+ }
{ | ProtCOM v0.1 * Protected mode serial port handler for DOS | }
{ | Copyright (C) 2024 Pozsar Zsolt <[email protected]> | }
{ | testprco.pas | }
{ | test program for ProtCOM unit | }
{ +--------------------------------------------------------------------------+ }
{
This program is Public Domain, you can redistribute it and/or modify
it under the terms of the Creative Common Zero Universal version 1.0.
}
{$IFNDEF GO32V2}
{$MESSAGE FATAL This unit can only be used on DOS!}
{$ENDIF}
program testprco;
uses
crt,
protcom;
var
c: char;
begin
connect('com1'); // COM1
config(3,8,1,1); // 9600, 8 N 1
write('Colors:');
textcolor(lightgreen); write(' received data');
textcolor(lightred); writeln(' trasmitted data');
repeat
if not keypressed then
begin
if canread then
begin
textcolor(lightgreen);
write(char(recvbyte));
end;
end else
begin
c:=readkey;
sendbyte(ord(c));
textcolor(lightred);
write(c);
end;
until c=#27;
textcolor(lightgray);
disconnect;
end.