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 [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on behalf of Tom Marchant [000000a69b48f3bb-dmarc-requ...@listserv.uga.edu] Sent: Monday, January 24, 2022 2:01 PM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU 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 <m42tom-ibmm...@yahoo.com> 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 > >On Fri, 21 Jan 2022 09:32:07 -0500, Dave Clark <dlcl...@winsupplyinc.com> >wrote: > >>My program is being >>called by REXX and I'm not aware of any documentation stating what kind of >>register save area REXX provides. That is why I asked and was wondering >>if there is, perhaps, a code in the first word of the save area that >>indicated the format used -- and, in the absences of such a code, the >>72-byte savearea is all there is.