GARTHWILSON wrote:
The context was one of telling what the C flag's meaning from a previous operation was, or why you'd start the subtraction with CLC instead of SEC, or something that might be a little unconventional.
Sure.
My point is that one should probably be circumspect about applying these
rules, they're not absolute.
So I think it's appropriate to note in the coments that the carry flag
will always be set but it strikes me as a little nutty to make it explicit with
and SEC instruction (unless there's some good reason to of course, eg
you're branching here) just because of some rule about what "unreliable
spaghetti code" looks like (because you might some day want to branch
here for some reason).
GARTHWILSON wrote:
That's just wasteful clutter because it does not introduce any new information. But anything that's not immediately clear from the code itself should be explained in the comments.
hmm
As to the above example I'd include the comment even if I thought it
should be immediately clear from the code
The example of 16 bit subtraction was meant as a ridiculous extreme.
So I, (and I assume, you) would consider a full blown tutorial on muti-
byte arithmetic, detailing what happens with the carry flag, as probably
a bit of overkill.
However, part of my dogma is 'there's no such thing as too many comments'
so I certainly wouldn't argue that it would necessarily be too much.