Hi!
What you are trying to do is called the Kermit Protocoll.
It was widely used in the late 70s and early 80s on then unstable serial lines.
There were a lot of implementations in C, Turbo Pascal, Basic , ...
You should find the Turbo sources in the Net.
If you set the fpc in the Turbo Mode then the Port Array is supported (Only Linux and DOS).
With a port assignement you can directly fetch or send bytes from the UART.
That's how we used the serial lines at that time with CP/M or DOS.
I don't know if that works with todays Hardware and OS but you could give it a try.
Winni
PS.: The Kermit sources for nearly everything including Turbo Pascal:
http://www.columbia.edu/kermit/archive.html