From the COBOL Cafe: 
https://www.ibm.com/developerworks/community/forums/html/topic?id=e055e63f-4e61-4502-b04c-db9b3d89d213

Allan Kielstra, from Markham, on a question of whether COBOL V5+ uses the 
FASTLINK calling convention.

'This is a bit confusing.  Even I was confused while I was implementing it.  
:-)  There are a number of variants of the basic "OS Linkage."  That's the 
linkage that uses R1 as a pointer to a block of incoming arguments (or outgoing 
parameters.)  One of those variants is called "C private," and it is the one 
that is used by C.  To tell that you are C private, you start by "pretending" 
that you are fastlink.  All the magic is here in the PPA1:

 0003F8  90                                                     =AL1(144)       
   Flags


That's the program flags at offset hex 18 in the PPA1.  The value 1 in the top 
bit says "fastlink stack frame layout."  But that is "waved off" by the value 
001 in the next three bits.  That means "C private" convention.  So we always 
generate a 9x for that field of the PPA1.   (In fact a 90.)

That note about returning a doubleword binary item is something that did change 
between V4 and V5.  The C private calling convention requires that such items 
be returned in storage whose address is passed as a hidden first argument.  The 
V4 compiler didn't implement that quite right but it did everything else 
correctly for C private.  The V5/V6 compiler also implements C private and it 
adheres to the specification correctly even in this case.

So the bottom line is:  we use C private and not fastlink for COBOL.'

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to