From: Bernd Oppolzer <bernd.oppol...@t-online.de>
Date: Saturday, 11 February 2012 3:36


>My favourite one is:
>
>     BALR  R3,0     SUBTRACT 1 FROM R3
>
>Obviously, the opcode is wrong, should be BCTR.
>
>But: it took me three months (!!!) to find the error, because I always
>looked
>at the comment - at least 20 times - and never realized that the
>operation did
>something totally different than the subtraction suggested by the comment.
>
>This was a length calculation before an EXed MVC, and the program crashed
>sometimes due to the wrong length - but not always. The testers told me over
>and over again, that there must be something wrong with this module, but I
>simply didn't realize it.

Macros provide the means to automate common tasks
and avoid mistakes like that.

In this case, BCTR is inappropriate, because the length can be zero,
and use of SH provides the means to test for negative and to skip
the MVC (or CLC).


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to