??? 12/07/06 14:50 Read: times |
#129128 - aaah now I see what you meant... Responding to: ???'s previous message |
... by "meaningless".
OK, so you want the labels to be "self-commenting"? Isn't that YOU who speak against the "self-commenting code" idea? The whole idea of "neat code" is much of psychologic character hence subjective (unless "commonly accepted style" is around, which for asm is AFAIK not - please correct me if I am wrong). My way is, spare time by not thinking on creating label names inside a routine, spend the same time on commenting. This pays off, as some of the labels (my guess is >50%) are trivial=meaningless, but there are other places without labels worth commenting. In my way, to read the program, you need to look only at the comments. Simplistic and slightly exagerrated example: CompareNum: mov a,Num1 cjne a,Num2,CompareNum_1 blah blah1 ;if Num1=Num2 blah blah2 ;do blahblah sjmp CompareNum_9 CompareNum_1: jc CompareNum_2 blah blah3 ;if Num1<Num2 blah blah4 ;do something else sjmp CompareNum_9 CompareNum_2: blah blah5 ;if Num1>Num2 blah blah6 ;do something blah blah7 ;and fallthrough to end CompareNum_9: retAlso, using a character not used elsewhere (e.g. underscore - although I use a different character, I don't like underscores) for the unimportant labels, one quickly develops a habit to ignore the unimportant labels and see the important (routine names) only. This might work for one and might not for other, of course. JW |