On Wed, 5 Oct 2005 17:41:35 -0700, in bit.listserv.ibm-main
(Message-ID:<[EMAIL PROTECTED]>)
Skip Robinson <[EMAIL PROTECTED]> wrote:
<snip and paraphrase:>
Comparing the merits of
CLC =C'IOLQ',3(R6)
vs.
CLC 3(4,R6),=C'IOLQ'
I don't think this is about natural language influence.
It's just about
programming convention based on experience.
I disagree. I believe that the "natural" way to code
is the latter specifically because of linguistic influence.
You might ask if a shirt costs $15; it would sound
very odd to ask if $15 was the cost of the shirt. When
dealing with some other comparisons (such as weight), it's
practically impossible to reverse the order. The value to
compare the item in question to comes second.
Within ASM, it is even more evident when you want an
inequality. The natural way to ask is "Is this variable
less than 5?" So, you compare the variable to 5 and BL for
"yes". You don't want to compare 5 to the variable and BNL
for "yes". (As someone put it, "Code as if whoever
maintains your code is a violent psychopath who knows where
you live.")
Reversing the order, necessitating reversing the
question, is part of what makes COND= on the JCL statements
so hard to figure out. Instead of asking if the CC is >=
4, you must compare 4 to the CC and then determine what
operator to use.
I agree that, at least for equalities, putting the
literal first is the better technique. I just don't
consider it "natural". And, I don't think I'd ever use it
if I needed to follow it with anything but BE or BNE.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html