Difference between revisions of "Assembler:Commands:LOOP"

From Cheat Engine
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Category:Assembler]]
 
'''command''' loop ''operand''
 
'''command''' loop ''operand''
  
Line 9: Line 10:
 
Performs a loop operation using the ECX or CX register as a counter. Each time the LOOP instruction is executed, the count register is decremented, then checked for 0. If the count is 0, the loop is terminated and program execution continues with the instruction following the LOOP instruction. If the count is not zero, a near jump is performed to the destination (target) operand, which is presumably the instruction at the beginning of the loop. If the address-size attribute is 32 bits, the ECX register is used as the count register; otherwise the CX register is used.
 
Performs a loop operation using the ECX or CX register as a counter. Each time the LOOP instruction is executed, the count register is decremented, then checked for 0. If the count is 0, the loop is terminated and program execution continues with the instruction following the LOOP instruction. If the count is not zero, a near jump is performed to the destination (target) operand, which is presumably the instruction at the beginning of the loop. If the address-size attribute is 32 bits, the ECX register is used as the count register; otherwise the CX register is used.
  
[http://x86.renejeschke.de/html/file_module_x86_id_161.html x86.renejeschke.de/html/file_module_x86_id_161.html]
+
[http://c9x.me/x86/html/file_module_x86_id_161.html c9x.me/x86/html/file_module_x86_id_161.html]
 
</div>
 
</div>
  
Line 30: Line 31:
 
  LOOP loop_start
 
  LOOP loop_start
  
== See also ==
+
{{AssemblerCommandSeeAlso}}
* [[Assembler]]
 
* [[Cheat_Engine:Auto Assembler|Auto Assembler]]
 
* [[Assembler:Commands|Assembler Commands]]
 
  
== External links ==
+
{{Template:AssemblerCommandExternalLinks}}
* [https://wikipedia.org/wiki/X86_instruction_listings wikipedia.org/wiki/X86_instruction_listings]
 
* [https://wikibooks.org/wiki/X86_Assembly/Other_Instructions wikibooks.org/wiki/X86_Assembly/Other_Instructions]
 
* [http://x86.renejeschke.de/ x86.renejeschke.de]
 
* [http://www.asmpedia.org/index.php?title=Main_Page asmpedia.org]
 

Latest revision as of 15:49, 3 January 2018

command loop operand

The LOOP instruction assumes that the (E)CX register contains the loop count. When the loop instruction is executed, the (E)CX register is decremented and the control jumps to the target label, until the (E)CX register value, i.e., the counter reaches the value zero.

Used for Loop control.


Performs a loop operation using the ECX or CX register as a counter. Each time the LOOP instruction is executed, the count register is decremented, then checked for 0. If the count is 0, the loop is terminated and program execution continues with the instruction following the LOOP instruction. If the count is not zero, a near jump is performed to the destination (target) operand, which is presumably the instruction at the beginning of the loop. If the address-size attribute is 32 bits, the ECX register is used as the count register; otherwise the CX register is used.

c9x.me/x86/html/file_module_x86_id_161.html


Command Parameters[edit]

Parameter Description
operand The address or symbol to jump to


Examples[edit]

label(loop_start)
MOV ECX,10
loop_start:
// loop body
LOOP loop_start

See also[edit]

External links[edit]