Nice thoughts, but I do not believe that is the rule. I believe the stated rule 
is that everyone must preserve high halves for their callers. If you break it, 
you put it back together before returning. See Peter Relson 6/14/2016 "LINK and 
high order word of R1."

> If you use it, you save it and restore it for your caller.

> save ... in your own storage before you call someone else

A safe set of advice, but it ddoes imply lots of superfluous saving: save 
before calling, even if the callee might not modify, and even if the callee 
might be saving them itself.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Farley, Peter x23353
Sent: Wednesday, October 17, 2018 3:52 PM
To: [email protected]
Subject: Re: COBOL 64bit

The simple answer to the "problem child" case is not "don't do that", but 
instead:

If you use it, you save it and restore it for your caller.  Don't expect anyone 
else to save it, so if you really need it after you get started then save again 
in your own storage before you call someone else who may or may not preserve it.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Paul Gilmartin
Sent: Wednesday, October 17, 2018 6:38 PM
To: [email protected]
Subject: Re: COBOL 64bit

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.
>
>... A program could be AMODE 31 but either destroy the high halves of a 
>caller's registers and/or expect a called program to preserve the high halves 
>of its registers. (There are many common uses of all 64 bits of a register 
>outside of AMODE 64.)
> 
Sounds like a "Don't do that!"  Must a 31-bit caller not depend on both
halves of R2-R13 being preserved by a 31-bit subroutine?

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

Reply via email to