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

Mehmet Erol Sanliturk sanliturk at ttmail.com
Mon Jan 18 06:58:02 CET 2010

John Youngquist wrote:
> Interesting response.
> I routinely implement large systems on the 8051 chip in assembly language
> which I can write faster than Pascal. Assembly is a minimum of 500% 
> faster than
> C on the 8051. I hate C anyway.
> The machine is a pick & place machine designed to assemble SMT
> circuit boards. It was originally controlled by a Borland Basic 
> program written in
> Japan without any useful comments. With 5 or 6 statements per line 
> without even
> a single space it looked like Japanese to me. Initially I needed to 
> fix a few bugs
> and add a few features so I studied the code for while - all 100K 
> statements of it.
> I decided rewriting it from scratch would be faster that figuring it 
> out. In exactly 2 weeks
> I had replicated and enhanced the original functionality with 3K lines 
> of Pascal. I still
> had to study the code to figure out how drive their special hardware, 
> but over the years
> all of it has been replaced with simpler stuff. Numerous enhancements 
> have
> swelled the code to 8K lines using less than 2 64K blocks of memory.
> The before/after size ratio shows how poorly the basic was done.
> As implemented in BP it works very well. The multi-tasking part handles
> functions that are not time critical, operating air cylinders that 
> don't know what a mSec
> is. The fast motion is handled independently by Animatics Smart motors.
> I have never explored the multimedia timers. I drive the LPT int to 
> get my own periodic
> interrupt because the multi-task code already uses the timer. As you 
> know there are 3
> timers in the timer chip but only one will generate an interrupt.
> One problem I have yet to solve is the BP IDE when it hits a 
> breakpoint kills my LPT interrupt.
> Nothing but an IDE restart will restore it. It sure cramps your 
> debugging style.

You may think


in a simple PC with Free Pascal


I think , you may directly use your Pascal program in DOS mode : Port 
I/O , Interrupts , etc.

Thank you very much .

Mehmet Erol Sanliturk

More information about the fpc-pascal mailing list