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

Sven Barth pascaldragon at googlemail.com
Sun Jan 22 09:19:47 CET 2012


On 21.01.2012 20:12, Paul Robinson wrote:
> ---- Start of Message by Paul Robinson ----
>
> WITH MESSAGE DO
>
> BEGIN
>
> Sven Barth wrote (quoting me):
>
>
>>> That (PASCALMAIN) will have to change, the object file format for 370 machines limits a CSECT to 8 characters, with the
>>> optional characters @ # and $.  So I might call it MAIN or possibly #MAIN.  (On the PDP/11, most operating systems (RT-11,
>>> RSTS/E, RSX) defined the main program in any language as ".MAIN." )
>>
>> If I understand you correctly, then you might confuse label names with section names.
>
> No, I know exactly what I mean.  Label and section names are under the same rules in an assembler program on the 370, and a CSECT in 370 Assembly language
>
> THENAME    CSECT
>
>   is equivalent to
>
> Procedure THENAME;
> (* in Pascal *)
>
>         SUBROUTINE THENAME
> C       in Fortran
>
> 000010 PROCEDURE DIVISION.
> 000020 PROGRAM-ID.  THENAME.
> 000030*  In Cobol
>
>
> int thename(void) {
> /* In C */
> }Excepting, of course, for the brain-dead moronic behavior of assigning case-sensitivity to identifiers in C.

This is something you'll definitely need to investigate, because the 
mangled Pascal identifers (for variables, procedures, etc.) are normally 
MUCH longer than 8 characters. For procedures they contain the unit 
name, the procedure's name and the types of all arguments (for 
overloading). You can see this if you compile a program with the "-al" 
argument, which will tell the compiler to leave the assembler files so 
you can take a look at them (normally called "unitname.s").

Another possibility would be to research whether there are other 
assemblers which don't have that restriction. Is there C++ available for 
this system? If so you can check what that uses as an assembler, because 
C++ uses mangled names as well.

Regards,
Sven



More information about the fpc-devel mailing list