> the save area that contains it I have no idea what that means. The callee sets (or doesn't set) the second word of the save area that the caller provides.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Assembler List [[email protected]] on behalf of Tom Marchant [[email protected]] Sent: Tuesday, January 25, 2022 10:48 AM To: [email protected] Subject: Re: Saving Caller's 64-bit Regsiters The second word of a save area does not tell you about the save area that contains it. It tells you about the previous save area, either its address or its format. If it is a 144-byte (or larger) save area, there are two possible forward pointers. One at +8 and the other at +X'80'. Both can be valid. And if there is a program on the calling chain that used BAKR to save its caller's register, there is no way to chain forward. Of course, you can look for a Linkage Stack entry that contains R13 that matches the address of the save area that you want to chain forward from, but that's not exactly following the chain. -- Tom Marchant On Mon, 24 Jan 2022 21:08:54 +0000, Seymour J Metz <[email protected]> wrote: >I'm a bit confused. I understand that there is no way to determine whether the >the caller has provided a 144-byte save area. However, I don't understand the >issue for running the forward chain, assuming that all called routines have >set the forward pointer, other than detecting the end of the chain. > >If +4 (word 2) is on a word boundary then the save area is either unused or is >72 bytes. If word 2 is FxSA (C6FxE2C1) then it is a 144-byte save area; >anything else and it is invalid. > > >-- >Shmuel (Seymour J.) Metz >http://mason.gmu.edu/~smetz3 > >________________________________________ >From: IBM Mainframe Assembler List [[email protected]] on behalf >of Tom Marchant [[email protected]] >Sent: Monday, January 24, 2022 2:01 PM >To: [email protected] >Subject: Re: Saving Caller's 64-bit Regsiters > >Replying to my own post to elaborate a little. > >When a program allocates a save area to pass to its callers, there is only >one word, the second word, that it can use in the new save area. >Everything else is reserved for the called program. The oldest documentation >for the standard 72-byte save area that I have been >able to find was published in 1966, but I'm sure the convention is much >older than that. >http://secure-web.cisco.com/1P_M4Kn04j805qzv6FEXzzkJc72DABsMkH1V50UzLffLOJYSS4IDUSU6IL5KElD85KF9b9vQS7m-XWUJr1Qs8y6ASTjLRALYYmRaA4xtaOHBIqDpn05SWhjrt5NLMqjG1wPj8RS5IQ7sAj_S5SsMpMoWLiZOj2fulcoqKBW9fCz0XQ0iABNvXXE8Nb_rZffVlfhoJSEczKuSHhVrfaG8OVOwhKHJR66rGn4iy-1jEL7I19pHoVfArekFfNZiADd6SySxwVYOcWgQx-58dxbEMzdlQfReAwQPrbt1QnhaWcVEl0M6p3QcQuUmYqM90zVY5EyJ1H36HURMPy-H3nTYj7k1_7lvqHfGWj0lkTBVNOGhstkxKYbY0Py-yHIqVrQRhZ0MKXkASwdOMM4UalZuJ_e5UNki-A3L7JKTJ30EAgEivK0wgFD54zy8Ad5MespwF/http%3A%2F%2Fwww.bitsavers.org%2Fpdf%2Fibm%2F360%2Fos%2FR01-08%2FC28-6541-1_Control_Program_Services_Apr66.pdf >That manual says that the forward chain is optional. And so, the forward >chain has never been reliable. > >When I'm following save area chains in a dump, starting with R13, I look >at the second word. If it is an address, I know that the save area at that >address is a standard 72-byte save area. If it is F4SA, F5SA, F7SA, or F8SA, >offset X'80' from R13 is the address of the save area, and I know what >format it is. > >It is a little like the problem of where to store the value of R13 upon >entry to my program. It doesn't do me any good to store it in the save >area that my caller passed me. So I save it in the save area that I >allocate for the programs that I call. > >-- >Tom Marchant > >On Mon, 24 Jan 2022 11:20:20 -0500, Tom Marchant <[email protected]> >wrote: > >>If your program can be called by a program that you don't control, and that >>doesn't document that it provides something more, you have to assume >>that you re only provided a 72-byte save area. >> >>There is no code that a program can provide in the first word of a save area >>that could describe the save area. That is because the first word is defined >>as for the use of language products. >> >>-- >>Tom Marchant
