[fpc-devel] Re: EBCDIC ( was On a port of Free Pascal to the IBM 370)

Daniël Mantione daniel.mantione at freepascal.org
Mon Jan 30 21:34:22 CET 2012

Op Mon, 30 Jan 2012, schreef steve smithers:

>> Hans-Peter Diettrich wrote on Mon, 30 Jan 2012 17:40:27 +0100
>> Existing source code frequently assumes ASCII encoding. The obvious are
>> upper/lowercase conversions, by and/or or add/sub constant values to the
>> characters. It will be hell to find and fix all such code in the
>> compiler and RTL, even if only the constants have to be modified for
>> EBCDIC. Even code with the assumed order of common characters (' ' < '0'
>> < 'A' < 'a') has to be found and fixed manually - how would you even
>> *find* code with such implicit assumptions?
> It does indeed.  I am aware of the problems inherent in this.  But the RTL
> has to be more or less rewritten anyway to support OS.  OS is a very different
> animal to Windows or Linux.

If you try to achieve a port by modifying all code that deals with 
characters you will fail. The amount of work becomes then far too big for 
a single person, and the modifications become too huge and wide-spread 
that you will raise objections for merging it with the SVN trunk.

In other words, do yourself a favour and keep ALL processing in ASCII. You 
can convert between ASCII & EBCDIC on input/output. That way the 
modifications in order to support EBCDIC are well concentrated in a single 
piece of code, which can be easily merged without risk of destabilizing 
the code base.

You can then use your manpower, and you still need *a* *lot* of it, to 
write a code generator & RTL.


More information about the fpc-devel mailing list