[fpc-devel] EBCDIC (was On a port of Free Pascal to the IBM 370)
Michael Van Canneyt
michael at freepascal.org
Mon Jan 30 19:10:51 CET 2012
On Mon, 30 Jan 2012, rvmartin2 at ntlworld.com wrote:
> michael.vancanneyt at wisa.be wrote the following on 30/01/12 16:35:20:
>> On Mon, 30 Jan 2012, rvmartin2 at ntlworld.com wrote:
>>> michael.vancanneyt at wisa.be wrote the following on 30/01/12 14:49:53:
>>>> I think the reason for producing an ASCII version first is very simple:
>>>> All FPC sources - including the compiler - are in ASCII encoding.
>>> I don't understand this statement - ASCII and EBCDIC are just human representations of a computer's internal code.
>>> I write my programs in the Latin (or Roman) alphabet and the computer does the rest.
>>> When I was writing VS/Pascal programs I used the same source code as input to VS/Pascal on the mainframe and to Virtual Pascal on the PC.
>>> Unless the FP source code is to be fed into a mainframe compiler like
>>> IBM's VS/Pascal or the Stanford compiler then the first step is surely to
>>> write a backend for the (eg PC) compiler to produce 370 assembler code.
>>> Producing EBCDIC rather than ASCII sounds a trivial part of the task.
>> I had in mind the following scenario:
>> 1) Somehow we build - using cross-compilation - a first version of the
>> compiler that actually runs on the 370. This binary is transferred to a
>> 370 machine.
>> 2) The sources of the compiler and RTL are transferred to the 370.
>> I assume that after the file transfer, the sources are still in ASCII format ?
> No - sending source code from a PC to a 370 performs an automatic translation to EBCDIC (and vice versa).
I think that very much depends on the program you use to send the file.
We have a mainframe here, and sending ASCII files using FTP in binary mode,
most certainly does not do any translation. I suppose the same goes for SCP,
although I never tested that protocol myself.
And that is what I meant: unless you do the translation explicitly
(and by this I also understand email, ASCII mode FTP transfer and whatnot)
the compiler will see ASCII sources, even on the IBM.
More information about the fpc-devel