[fpc-pascal] Challenging port of Borland Pascal program to FPC

John Youngquist johny at iaw.com
Sun Jan 17 17:48:13 CET 2010

Hi:   I have been using FPC for some time now and think it is a great 

I am facing a challenging port of a Borland Pascal 7 program to FPC. It 
is about
8000 lines long. While most of it is ordinary and will compile easily it 
uses some
features and extensions which I don't know how to handle in FPC.

1) It does direct I/O to port addresses via the Borland Port[xxx] feature.
2) It uses a buffered interrupt driven RS-232 facility to receive and 
direct access for transmit.
3) It uses the RS-232 control lines separately to to additional 
unrelated I/O while normal serial I/O is in progress.
4) It reads/writes the LPT port.
5) It uses interrupts on the LPT port. About 35K ints/sec are used to 
drive stepper motors.
6) it writes to a 48 I/O line card on the ISA bus. (hard to find ISA bus 
7) it uses an excellent multitasking library written by Dieter Pawelczak 
from Germany.
    This allows execution to be interrupted and other tasks run based on 
time scheduling.
    A simple example would be to set a port bit in the main program and 
then schedule
    a task to run say 10 msec later which turns it off. The  main 
program would run normally
    until the 10 msec time limit is reached at which time the main is 
suspended briefly while
    the scheduled task is run. Of course there are various restrictions 
and pitfalls because of
    rentrancy issues. But it works well when used properly. The source 
code is provided for
    this library including a bunch of 16 bit oriented ASM code.
8) To avoid OS intervention on I/O port access Windows98 is used.

I would like to port the program as is, but eventually get a PCI 48 I/O 
line card to escape
the ISA bus and also talk USB as well. Getting it to run on later 
versions of Windows might
be useful. This program controls a machine on a single purpose computer. 
Windows is used
to handle files, networks, and little else. Most of the time only this 
program is run. A port to
Linux might be acceptable if that would solve some problems.

Are these insurmountable obstacles?


John Youngquist

More information about the fpc-pascal mailing list