|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ä |
We
can take advantage of CX as a loop
|
|
|
|
counter
to speed up the program
|
|
|
MOV AX,
InitialValue
|
|
|
MOV BX,
OFFSET ArrayX
|
|
|
MOV CX,
ArraySize
|
|
|
JCXZ DONE
|
|
|
InitLoop: MOV [BX],AX
|
|
|
ADD BX,2
|
|
|
LOOP InitLoop
|
|
|
...
|
|
|
DONE:
|
|
|
ä |
Only
CX can be used as a loop counter
|
|
|
|
ä |
Compilers
(good compilers) generate code to
|
|
|
take
advantage of special instructions that help
|
|
reduce
execution time
|
|
|
|