On Thu, Feb 3, 2011 at 6:29 PM, Tony Thigpen <t...@vse2pdf.com> wrote:

> Personally, I consider a 'branch to abnormal exit' much better than
> trying to unwind all the 'perform' levels, be it COBOL or Assembler.
>
> I have seen programs where they attempted to unwind everything during an
> error and ended up processing code unintentionally.

My father used to say that 'anything with "too" in it is bad'  and I
had to think of that when I was recently trying to untange some
ancient code. I allow myself premature exit to the end of the routine
as well, but it's a glippery slope. At least I find that when you
don't give it enough thought, it's easy to end up with a lot of them
and make following the flow much harder.

My dialect of Structured Assembler does a combined "call with
automatic exit on nonzero return code"  Though this is the same as
coding that extra branch, the simplification to me is that it's always
the same NZ that does the exit. If necessary, I will put a number of
those diverse tests in a subroutine and let that conclude Z or NZ.
That avoids things like this:
  CLC   DEVADDR,RANGELO
  BL     EXIT
  CLC   DEVADDR,RANGEHI
  BH     EXIT

| Rob

Reply via email to