JmpCtr dw 11 dup(0)
..
MOV CX, 0
JmpLoop: Inc JmpCtr[0] ; There is no excuse for bad comments
CMP CX, 4800h ; in well-written source code.
JAE BigNum
Inc JmpCtr[2] ; Unfortunately, these are bad comments!
MOV AX,0F000h
ADD AX,CX
JC JCdone ; Good comments help you understand
Inc JmpCtr[4] ; what the program is doing.
TEST CX,1
JZ JCDone
Inc JmpCtr[6] ; Bad comments are just a waste of time,
; both for the author and for the reader.
JMP JCDone
BigNum: Inc JmpCtr[8]
CMP CX,6000h ; It would be silly, for example, to have
JGE RealBig ; a comment like: 'Compare CX to 6000 hex'
Inc JmpCtr[10] ; since the code already says that!
CMP CX,-32512
JL Small ; It is a good idea to give your
Inc JmpCtr[12] ; jump labels meaningful names
CMP CX,57
JO HappyLabel ; Note that this label is useless
JS JCDone ; as you try to understand the program
Inc JmpCtr[14]
NOP ; No operation - Let the CPU rest for a cycle.
JMP JCDone
HappyLabel:
Inc JmpCtr[16] ; Joy joy Joy
JMP JCdone
RealBig: Inc JmpCtr[18] ; This label was more logical.
JMP JCdone
Small: Inc JmpCtr[20]
JMP JCdone
JCDone: Inc CX
CMP CX,0A000h ; Continue with main loop of program
JNE JmpLoop
RET |