You are here : assembly8086LOOP

LOOP - 8086

Decrease CX, jump to label if CX not zero.

Algorithm:

  •  CX = CX - 1
  •  if CX <> 0 then
    •  jump
  • else
    •  no jump, continue


Syntax

LOOP Label


Example

.model small
.data
  ...
  
.code
  ...
  ...
  mov cx,10	;number of times to repeat
  label:
    ...
    ...
    ...
  loop label	
  ...
  ...
  end


Output / Return Value


Limitations


Alternatives / See Also


Reference