On 9/13/2010 8:22 AM, Paul Gilmartin wrote:
On Mon, 13 Sep 2010 07:33:13 -0600, Steve Comstock wrote:

R1 does not matter. From the Assembler Services Guide:

Unless otherwise defined by the individual interface, the
calling program should expect, upon return, that
* The low halves (Bits 32-63) of GPRs 2 through 13 are unchanged
* The high halves (Bits 0-31) of GPRs 2 through 14 are unchanged
.
Clarification:  I'm not thinking of system services, but of a
putative user program, AMODE 31, which has hitherto guaranteed
that R1 is preserved.

Well guaranteeing that R1 is preserved does not follow
the conventional standard (see quoted above), so it
would be a rare program that did so.

Furthermore, if this is a traditional program, it
really was really only guaranteeing the low word
(rightmost 32 bits) because it never had to concern
itself with the lefmost 32 bits; in the code below,
the low word is still maintained.

I've been around long enough to never say never, because
programmers will do the strangest things. But for all
practical terms I can't see this raises any potential
problems and it provides a nice little option for
programs that want to run in AMODE64. (Recall that
GETMAIN can't allocate storage above the bar, this
new feature simply ensures the effective address is
a 64-bit address if that's helpful.)


It does the conventional:

     STM    R14,R12,12(R13)
     GETMAIN
         ...
         Stuff
         ...
     FREEMAIN
     LM     R14,R12,12(R13)
     BR     R14

Suddenly, with no change in either the calling or the called
code, the caller will find that the top half of R1 is destroyed.

-- gil


--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
  + Training your people is an excellent investment

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

Reply via email to