[fpc-devel] On a port of Free Pascal to the IBM 370

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Wed Jan 18 13:56:59 CET 2012



On Wed, 18 Jan 2012, Tomas Hajny wrote:

>> But then you are assuming the RTL should be using EBCDIC internally as
>> well ?
>> Obviously, that will be a lot more work.
>>
>> But I don't think this should be so.
>
> I may be overlooking something, of course. However: Our RTL is based on
> common (target specific) routines for reading (and writing) text and
> binary files (do_read & do_write). You cannot translate between ASCII and
> EBCDID in these target specific routines because you don't know how the
> input would be used at that point (not even mentioning the fact that there
> is nothing like translation between ASCII and EBCDIC because there are
> multiple different character sets for both and real conversion isn't
> possible without taking this into account and knowing the real character
> sets which again depends on the context which is again not known at this
> low level).

Once more: I do not think this is the task of the RTL. FPC and the RTL works 
with ASCII. That includes the expected contents of text files and whatnot.

That a hypothetical FPC program opening an EBCDIC file on OS/370 needs to
convert this to ASCII first is in my view the responsability of the programmer.

The same goes for the FPC sources. 
I do not suppose that a FPC port would first convert the current ASCII
sources to EBCDIC, but would continue to use the ASCII version.

If you define the RTL as being able to handle EBCDIC on OS/370, 
it is a different matter, and a lot more work.

Michael.



More information about the fpc-devel mailing list