Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

ASSEMBLER-L - Versteckte Fehler, verschleiert durch irreführende Kommentare

Subject:

Re: code comments

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU>

Date:

2012.02.10 17:32:28


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.

Kind regards

Bernd



Am 10.02.2012 16:46, schrieb M.S.:
> At 03:36 PM 2/10/2012 +0000, you wrote:
>> ...
>>
>> I was taught at an early age to read the code rather than the comments,
>> especially when one disagrees with the other.
> And I learned at an early age to look at the object code.
> This rule was hammered home when we purchased commercial software
> which contained such oddities as
>
> R3       EQU   5
>
> M.S.
>

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie