On Wed, 17 Oct 2018 15:20:44 -0700, Charles Mills wrote: >And FWIW there is another overlapping complexity here besides AMODE 64 >-- speaking in theory only, because there is no reality of 64-bit COBOL.
It isn't really "theory only" because it is true of assembler too. >There are really *three* kinds of module: those that are AMODE 64, >those that are AMODE 31 but use and/or count on the high halves of >registers, and those that are "pure" 31/32-bit. There are modules that use the high halves of registers and those that do not. Of those that do, some of them are AMODE(64) some of the time. Regardless of how a program uses the high halves of registers 2-12, the linkage conventions require that the program restore them before returning to its caller. >The whole save area thing has gotten to be a little bit of a pile IMHO. >It used to be the first two commandments: thou shalt do a >STM 14,12,12(13) on entry and thou shalt provide an 18-word save area >to callees. Now I am often in doubt and have to look up the rules and >then I am still in doubt. How many formats of save areas are there now? This is all documented in chapter 2 of the Assembler Services Guide. That chapter was extensively rewritten by Peter Relson for the z/OS 1.12 edition of the manual, and IMO it is now quite clear. The rules are simple. 1. When you call another program, register 13 contains the address of a save area that the called program will use to save your registers. The minimum size of that save area is whatever is required by the programs that you call. This is part of the called program's specifications. 2. When the caller receives control back when you return, o All 64 bits of General Purpose Registers 2 through 13 are unchanged from what they were when you received control. o AMODE is the same as it was when you received control. o Access Registers 2 through 13 are unchanged from what they were when you received control. o ASC mode is unchanged from what it was when you received control. -- Tom Marchant ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
