126 Jump (jmp, ljmp) jmp disp adds a signed offset to the address of the instruction following the jmp instruction to determine the destination that is, the displacement is relative to the next instruction. Exampleĭecrement the count register and when the count is not equal to zero, jump short to the disp8 location. The disp8 operand points to the beginning of the iterative loop. Then, add the loop instruction at the end of a series of instructions to be iterated. Prior to using the loop instruction, load the count register with an unsigned iteration count. Loop instructions provide iteration control and combine loop index management with conditional branching. The range of the disp8 operand, relative to the current instruction, is +127 decimal bytes to -128 decimal bytes. ![]() If the conditions match, a short jump is made to the address specified by the disp8 operand. Conditions are checked for by the particular form of loop you used. Loop decrements the count register the flags register remains unchanged. 126 Loop Control with CX Counter (loop, loopnz, loopz) loop disp8ĭecrement count jump to disp8 if count not equal 0ĭecrement count jump to disp8 if count not equal 0 and ZF = 0ĭecrement count jump to disp8 if count not equal 0 and ZF = 1 Description ![]() In this case, jcxz tests CX or ECX for 0 prior to entering the loop, thus executing 0 times: Example Jcxz is useful at the beginning of a loop that terminates with a conditional loop instruction such as: loopne. jcxz differs from other conditional jumps that it tests the flags, rather than (E)CX. The jcxz instruction tests the contents of the CX or ECX register for 0. Jump Instructions Jump if ECX is Zero (jcxz) jcxz disp8 Operation
0 Comments
Leave a Reply. |