> -----Original Message-----
> From: IBM Mainframe Assembler List
> [mailto:[email protected]] On Behalf Of Tom Marchant
> Sent: Monday, April 11, 2011 3:08 PM
> To: [email protected]
> Subject: Re: Best way to multiply doublewords?
>
> On Mon, 4 Apr 2011 07:27:13 -0500, McKown, John wrote:
>
> >you'd need to look at the passed in save area to see if you were
> >supplied with one which has room for the upper half of the registers.
>
> You can not tell by looking at the save area that was passed to you
> to determine the size of the save area that was passed to you. A
> program does not "determine". A program "requires". If your program
> requires a 144-byte save area, your callers must provide it. If you
> cannot control your callers, you have to operate on the assumption
> that you have only a 72-byte save area.
>
> The OP can simply save the high halves in his own storage if he
> chooses, but he should restore the high halves before returning to his
> caller.
>
> --
> Tom Marchant
OK. So, in order to be totally safe when the programmer cannot __guarantee__
that the caller has supplied a proper save area for 64 bit programs (i.e., the
caller might or might not use the 72 or 144 word save area format), then one
__must__ assume a 72 work standard save area, no? In which case, if called by a
routine which uses 64 bit register, you are in a quandry. Assuming you don't
have source to modify the caller, that is. I guess what could be done in this
case is to have two entry points. One to be used by routines which must have
their 64 bit registers saved. The other where it does not matter. Or, being the
paranoid person that I am, one could use the BAKR to save the register on the
linkage stack, ignoring the supplied save area in R13. Secondly, as you said,
save the low fullword of the registers in the save area. Then save the high
fullwords in an area the routine itself got (either in the program or via a
STORAGE OBTAIN). Lastly, one could save the low fullword!
of the registers in the caller's save area, then do a SYNCH to the actual
internal label where the processing occurs. Something like:
MYROUT CSECT
USING *,R11
SAVE (14,12)
LR R11,R15
SYNCH ROUTINE
RETURN (14,12),T,RC=(15)
ROUTINE DS 0H
...
GOBACK SVC 3
I guess I'd go with the program saving the high fullwords in a STORAGE
OBTAIN'ed area which is part of the "working storage". Or, if LE, in the DSA.
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone *
[email protected] * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or
proprietary information. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original message.
HealthMarkets(r) is the brand name for products underwritten and issued by the
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The
MEGA Life and Health Insurance Company.SM