Short jumps out of range

I have a problem with my loop, the code contained in it is long, and it gives me the error "short jump out of range", so I want to know if there is a way to make the loop work without reducing the amount of code in it?

example1:

label: my code LOOP label 

; It works fine, but when I add more code to it

example2:

 label: my code more code added LOOP label 

; It does not work, and the error "short jump out of range" appears

+4
source share
2 answers

The LOOP instruction cannot go over 127 bytes. You will need to change the code to use the DEC ECX with JNZ instructions.

For instance:

  MOV ECX, 10 label: ;some codes LOOP label 

Become:

  MOV ECX, 10 label: ;some codes DEC ECX JNZ loop 
+5
source

Have you tried the near statement?

0
source

All Articles