,
.
, .
. 4.30 , ,

8088.
 
, CX
, LOOP CX
. CX
. -
LOOP. LOOP CX
, CX 0.
CX ,
LOOP , .
 

LOOP.
 
MOV CX,LOOP_COUNT
BEGIN_LOOP:
; ...
LOOP BEGIN_LOOP
 

Microsoft (R) Macro Assembler Version 5.00 1/1/80 04:02:01
. 4.30 ࠠ Page 1-1
 
 
PAGE ,132
TITLE . 4.30
 
0000 CODE SEGMENT
ASSUME CS:CODE
 
;----------------------------------------
; .
; .
;----------------------------------------
 
0000 E3 06 JCXZ END_OF_LOOP ; , CX 0
 
0002 BEGIN_LOOP:
 
; ....
 
0002 E2 FE LOOP BEGIN_LOOP ; CX 0
 
; .... - ,
0004 E1 FC LOOPE BEGIN_LOOP ;
; CX 0
; ....
 
0006 E0 FA LOOPNE BEGIN_LOOP ;
; CX 0
 
0008 END_OF_LOOP:
 
0008 CODE ENDS
END
 
. 4.30
 
CX
. ,
LOOP. ,
, .
CX 0,
LOOP. 0,
,
. ,
CX.
: CX,

CX.
 
,
( , LOOP_COUNT -
),
.
0, 65536 . 8088
LOOP, CX 0 0FFFFH,
CX , .
, -
. JCXZ
(, CX 0).
CX, ,
. ,
. ,
, CX ,
.
, ,
JCXZ, ,
.
 
MOV CX,LOOP_COUNT_WORD
JCXZ END_OF_LOOP
BEGIN_LOOP:
; ...
LOOP BEGIN_LOOP
END_OF_LOOP:
 
JCXZ
. ,
, .
, , "" ,
,
.
 

.
REPE REPNE. LOOP ,
CX , LOOPE (,
) , ,
CX 0.
.
CX ,
. LOOPNE (,
) :
, ,
.
LOOPNE.
, ,
100.
, REPNE CMPSB
.
 
, DS:SI ES:DI
, .
 
MOV CX,MAX_LOOP_COUNT ;
BEGIN_LOOP:
LODSB ;
ADD AL,ES:[DI] ;
INC DI ;
CMP AL,100 ;
LOOPNE BEGIN_LOOP ;,
JE MATCH_FOUND ; ,




- - - -