On Thu, 18 Jul 2013 15:24:46 -0700, Tom Ross wrote:
>
>On the topic of evaluation of conditions, in z/OS COBOL our generated
>code will leave a condition evaluation as soon as we know it is true or
>false.  We do not keep evaluating other operands if the final result is
>clear from earlier ones.
> 
Has this forever been true?  If the historic behavior ever changed it
might have altered the side effects of evaluating the skipped expression.

Further afield, if one has (not COBOL syntax), e.g.:

    ( A + B ) * ( Big hairy expression )

it would be _so_ easy to insert a BZ right after the addition and
skip the rest of the evaluation.  For the mere cost of _one_ instruction.

Do the HLASM SPMs shortcut conditionals?  (I don't even know if
they provide complex boolean expressions.)

I once worked on a cross assembler for some idiosyncratic hardware
providing built-in conditional expressions.  The client and I agreed
that shortcutting conditioals (at run time) was desirable.  (The product
never went to market.)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to