John,

1)  No.  But, I think this would be a reasonable integrity check if one
has need to be concerned.

2)  No, unless expecting a variable number of parameters.  Again,
though, this would be a reasonable integrity check even when expecting a
fixed number or parameters.

When creating new routines, I prefer they be created in an "API-style,"
using macros for generating the parameter list and invoking the routine
as well as mapping the list of pointers and the fields to which they
point. This gives the called routine a relatively high degree of
confidence that the construction of the parameter list is valid.

Doug Watkins



The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it.

From: IBM Mainframe Assembler List
[mailto:[email protected]] On Behalf Of McKown, John
Sent: Wednesday, August 11, 2010 10:08 AM
To: [email protected]
Subject: Parameter passing: overly cautious or properly paranoid?

This is just curiousity on my part. I was thinking about standard
parameter passing in z/OS. That's where R1 points to a list of fullwords
containing address of parameters, with the last address having the high
order bit set and all previous addresses having the high order bit
unset. So I was wondering the following:

1) do you check to make sure that R1 actually points to a fullword
boundry. I.e. bits 30&31 are '0'b? Is this necessary or not? If R1
doesn't point to a fullword boundry, is that actually an error? That is,
do you feel that a proper parameter list must be fullword aligned?

2) do you always verify bit 0 of every fullword in the list of addresses
to make sure that you get the expected number of parameters? What do you
do if you get too few or too many?

John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-691-6183 cell
[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

Reply via email to