On Mon, 2 Aug 2010 15:34:06 -0600, Steve Comstock wrote:

>Tom Marchant wrote:
>> On Mon, 2 Aug 2010 13:21:15 -0600, Steve Comstock wrote:
>>
>>> On pages 21, 23, and 241 you refer to a F6SA; but you never define
>>> that; how is it different from a F4SA?
>>
>> There is no such thing as a F6SA or a F1SA.
>
>Then why do we see on p. 21 of the doc:
>
>"Set GPR 13 to indicate that the caller's registers are saved
>  on the linkage stack:
>    – If the program creates a save area, obtain a 72-byte
>      save area on a word boundary (or 144-byte or larger
>      on a doubleword boundary if routines called by the
>      program need that extra space) in the primary address
>      space:
>      1. Set the second word of the save area to the character
>         string 'F1SA' if obtaining a 72-byte save area or
>         'F6SA' if obtaining a 144-byte or larger save area"
>

When you create a save area for the programs you call, you set 
a value in offset 4 of that save area indicating how you saved 
the caller's registers upon entry to your program.

If you saved your registers in the old "standard" 72-byte save 
area, offset 4 contains the address of that save area (the "back 
chain").

If you saved the registers using the linkage stack, you signify 
that by placing 'F1SA' or 'F6SA' at offset 4.  There is no need 
for a DSECT to define the format that was used to save the 
registers.

The size of save area that you allocate will be determined by 
the needs of the programs that you call, and generally will NOT 
be reflected in the value that you store at offset 4.  The 
exception to this is the Format 5 and 8 save areas, which are 
used also to store the high halves of the caller's registers upon 
entry.  This is because the program only expects to be passed 
a 72-byte save area and it needs a place to store the caller's 
high halves.  If you are going to call a program that requires a 
216-byte save area (F7SA), you cannot use F5SA format to 
store your caller's registers.

This is a difficult subject to understand, in part because the usual 
method for identifying a control bloc does not apply.  I should have 
written, "There is no such thing as a 'Format 6 Save Area' or a 
'Format 1 Save Area'."  This is different from a Format 4 Save Area.

The value in offset 4 does not necessarily define a control block 
format.  In particular, when you place "F6SA" at offset 4, there is 
no need for a DSECT to define the format of the save area that was 
used to save the registers, because none was used.  The value at 
offset 4 DOES NOT define the format of the save area in which it is 
contained.  Furthermore, very little can be deduced about the 
contents or the size of a save area by examining the contents at 
offset 4.

>>Those values at
>> offset 4 in the save area that you create for programs that you
>> call are to document the fact that you stored your registers
>> using the linkage stack.  Perhaps the biggest clarification on this
>> version of the book is the meaning of the word at offset 4.  As
>> documented in "Using a caller-provided save area" on page 8.
>>
>> <quote>
>> In all save areas, the second word (the word at offset 4) of
>> each save area provides an indication of how the program that
>> created the save area saved the caller's registers. It does not
>> describe the contents of this save area.
>> </quote>
>>

-- 
Tom Marchant

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to