[fpc-other] Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Bernd Oppolzer bernd.oppolzer at t-online.de
Sat Dec 24 12:08:46 CET 2016


Hello Mark,

on several occasions, I looked what FPC does, when I extended the
Stanford compiler, for example when I added support for direct write
of scalars.

At one time I recall that I decided explicitly to take another direction;
that was when I allowed shorter string constants to be assigned to
longer ones, for example:

var x: array [1 .. 200] of char;

x := 'some string';

IIRC, FPC fills with hex zeroes, but I prefer blanks - the blank 
representation
of the target system ... which is different on the target systems; this 
should
show to some of the readers here which are not familiar with IBM mainframes
some of the difficulties I had to get the P-Code really portable ... all 
chars in
the (character) P-Code file had to be converted to character constants; all
places where character A - for example - was represented as numeric 193
(which is EBCDIC 'A') had to be found and corrected. Even such places where
the reference to 193 was not recognized at first sight, that is: offsets in
branch tables and bit strings representing sets.

This changes had to be done in the first pass of the compiler, which 
translates
the Pascal source to P-Code; the second pass (P-Code to machine 
instructions)
and the P-Code interpreter had to be adjusted accordingly.

See more information (including Pascal and P-Code examples) at the web site
mentioned below.

Regarding your question: There are - of course - some more incompatibilities
between FPC and Stanford Pascal; first of all, Stanford Pascal, as of 
now, is a
very small language, compared to FPC. My extensions of the last months are
motivated by my own needs and interests (and by my C and Pascal/VS 
experience,
to some degree); I wanted before all a Pascal based language that works 
the same on
Windows, OS/2, Linux and IBM Mainframe. I didn't want to compete with FPC,
not even in the long term. This looks impossible to me, from today's view.

Kind regards

Bernd



Am 24.12.2016 um 08:44 schrieb Mark Morgan Lloyd:
> On 23/12/16 23:00, Bernd Oppolzer wrote:
>> Hello FPC list,
>>
>> I would like to inform you, that I ported an improved version
>> of the Stanford Pascal compiler (a descendant of the Wirth P4
>> compiler) to Windows, OS/2 and Linux.
>>
>> I improved this compiler, which comes from the IBM mainframe,
>> by adding several features that I needed and that I found useful,
>> in the past few months.
>
>> You find some stories about my efforts of the last years and
>> months on my web site:
>>
>> http://bernd-oppolzer.de/job9.htm
>
> Well done Bernd. I remember that you were having some difficulty with 
> character array compatibility with FPC, are any of those still a problem?
>



More information about the fpc-other mailing list