LTJ UTJ
Likely Taken Jump / Unlikely Taken Jump
LTJ Jcc ; 02E [Pentium4 SSE2]
UTJ Jcc ; 03E [Pentium4 SSE2]
These instructions have no Mnemonic defined by Intel. Their Encodages are nothing but the older 'CS:' and 'DS:' Segment overrides.
These 'Branch Hint Prefixes' give information to the Processor about the more likely Code path that will be taken at a given Branching (Branch Predictions override).
These Prefixes can only be used with the Conditional Branch Instructions ( Jcc ).
See Intel Documentation for more info about the Branch Predictions mechanism.
LSS
Usage: LSS dest,src Modifies flags: None
Loads 32-bit pointer from memory 'src' to 'dest' register and SS. The offset is placed in the 'dest' register and the segment is placed in SS. To use this instruction the word at the lower memory address must contain the offset and the word at the higher address must contain the segment.
Load Far Pointer
LDS reg16,mem ; o16 C5 /r [8086]
LDS reg32,mem ; o32 C5 /r [386]
LES reg16,mem ; o16 C4 /r [8086]
LES reg32,mem ; o32 C4 /r [386]
LFS reg16,mem ; o16 0F B4 /r [386]
LFS reg32,mem ; o32 0F B4 /r [386]
LGS reg16,mem ; o16 0F B5 /r [386]
LGS reg32,mem ; o32 0F B5 /r [386]
LSS reg16,mem ; o16 0F B2 /r [386]
LSS reg32,mem ; o32 0F B2 /r [386]
These instructions load an entire far pointer (16 or 32 bits of offset, plus 16 bits of segment) out of memory in one go. LDS, for example, loads 16 or 32 bits from the given memory address into the given register (depending on the size of the register), then loads the 16 bits from memory into DS. LES, LFS, LGS and LSS work in the same way but use the other segment registers.
Example:
lss eax Label
LSL
Usage: LSL dest,src Modifies flags: ZF
Loads the segment limit of a selector into the 'dest' register if the selector is valid and visible at the current privilege level. If loading is successful the Zero Flag is set, otherwise it is cleared.
Load Segment Limit
LSL reg16,r/m16 ; o16 0F 03 /r [286,PRIV]
LSL reg32,r/m32 ; o32 0F 03 /r [286,PRIV]
LSL is given a segment selector in its source (second) operand; it computes the segment limit value by loading the segment limit field from the associated segment descriptor in the GDT or LDT. (This involves shifting left by 12 bits if the segment limit is page-granular, and not if it is byte-granular; so you end up with a byte limit in either case.) The segment limit obtained is then loaded into the destination (first) operand.
EXAMPLE:
lsl ecx Label
LOOPZ
Usage: LOOPZ label Modifies flags: None
Decrements ECX by 1 (without modifying the flags) and transfers control to 'label' if ECX is not zero and the Zero Flag is set. The 'label' operand must be within -128 or 127 bytes of the instruction following the loop instruction.
Loop with Counter
LOOP imm ; E2 rb [8086]
LOOP imm,CX ; a16 E2 rb [8086]
LOOP imm,ECX ; a32 E2 rb [386]
LOOPE imm ; E1 rb [8086]
LOOPE imm,CX ; a16 E1 rb [8086]
LOOPE imm,ECX ; a32 E1 rb [386]
LOOPZ imm ; E1 rb [8086]
LOOPZ imm,CX ; a16 E1 rb [8086]
LOOPZ imm,ECX ; a32 E1 rb [386]
LOOPNE imm ; E0 rb [8086]
LOOPNE imm,CX ; a16 E0 rb [8086]
LOOPNE imm,ECX ; a32 E0 rb [386]
LOOPNZ imm ; E0 rb [8086]
LOOPNZ imm,CX ; a16 E0 rb [8086]
LOOPNZ imm,ECX ; a32 E0 rb [386]
LOOP decrements its counter register (ECX) by one, and if the counter does not become zero as a result of this operation, it jumps to the given label. The jump has a range of 128 bytes.
LOOPE (or its synonym LOOPZ) adds the additional condition that it only jumps if the counter is nonzero the zero flag is set. Similarly, LOOPNE (and LOOPNZ) jumps only if the counter is nonzero and the zero flag is clear.
EXAMPLE:
mov ecx 10
mov edi MyString
mov al '0'
L0: stosb | inc al | loopz L0<
LOOPNZ
Usage: LOOPNZ label Modifies flags: None
Decrements ECX by 1 (without modifying the flags) and transfers control to 'label' if ECX is not = 0 and the Zero Flag is clear. The 'label' operand must be within -128 or 127 bytes of the instruction following the loop instruction.
Loop with Counter
LOOP imm ; E2 rb [8086]
LOOP imm,CX ; a16 E2 rb [8086]
LOOP imm,ECX ; a32 E2 rb [386]
LOOPE imm ; E1 rb [8086]
LOOPE imm,CX ; a16 E1 rb [8086]
LOOPE imm,ECX ; a32 E1 rb [386]
LOOPZ imm ; E1 rb [8086]
LOOPZ imm,CX ; a16 E1 rb [8086]
LOOPZ imm,ECX ; a32 E1 rb [386]
LOOPNE imm ; E0 rb [8086]
LOOPNE imm,CX ; a16 E0 rb [8086]
LOOPNE imm,ECX ; a32 E0 rb [386]
LOOPNZ imm ; E0 rb [8086]
LOOPNZ imm,CX ; a16 E0 rb [8086]
LOOPNZ imm,ECX ; a32 E0 rb [386]
LOOP decrements its counter register (ECX) by one, and if the counter does not become zero as a result of this operation, it jumps to the given label. The jump has a range of 128 bytes.
LOOPE (or its synonym LOOPZ) adds the additional condition that it only jumps if the counter is nonzero the zero flag is set. Similarly, LOOPNE (and LOOPNZ) jumps only if the counter is nonzero and the zero flag is clear.
EXAMPLE:
mov ecx 10
mov edi MyString
mov al '0'
L0: stosb | inc al | loopnz L0<
LOOPNZ
Usage: LOOPNZ label Modifies flags: None
Decrements ECX by 1 (without modifying the flags) and transfers control to 'label' if ECX is not = 0 and the Zero Flag is clear. The 'label' operand must be within -128 or 127 bytes of the instruction following the loop instruction.
Loop with Counter
LOOP imm ; E2 rb [8086]
LOOP imm,CX ; a16 E2 rb [8086]
LOOP imm,ECX ; a32 E2 rb [386]
LOOPE imm ; E1 rb [8086]
LOOPE imm,CX ; a16 E1 rb [8086]
LOOPE imm,ECX ; a32 E1 rb [386]
LOOPZ imm ; E1 rb [8086]
LOOPZ imm,CX ; a16 E1 rb [8086]
LOOPZ imm,ECX ; a32 E1 rb [386]
LOOPNE imm ; E0 rb [8086]
LOOPNE imm,CX ; a16 E0 rb [8086]
LOOPNE imm,ECX ; a32 E0 rb [386]
LOOPNZ imm ; E0 rb [8086]
LOOPNZ imm,CX ; a16 E0 rb [8086]
LOOPNZ imm,ECX ; a32 E0 rb [386]
LOOP decrements its counter register (ECX) by one, and if the counter does not become zero as a result of this operation, it jumps to the given label. The jump has a range of 128 bytes.
LOOPE (or its synonym LOOPZ) adds the additional condition that it only jumps if the counter is nonzero the zero flag is set. Similarly, LOOPNE (and LOOPNZ) jumps only if the counter is nonzero and the zero flag is clear.
EXAMPLE:
mov ecx 10
mov edi MyString
mov al '0'
L0: stosb | inc al | loopnz L0<
LOOPNE
Usage: LOOPNE label Modifies flags: None
Decrements ECX by 1 (without modifying the flags) and transfers control to 'label' if ECX is not = 0 and the Zero Flag is clear. The 'label' operand must be within -128 or 127 bytes of the instruction following the loop instruction.
Loop with Counter
LOOP imm ; E2 rb [8086]
LOOP imm,CX ; a16 E2 rb [8086]
LOOP imm,ECX ; a32 E2 rb [386]
LOOPE imm ; E1 rb [8086]
LOOPE imm,CX ; a16 E1 rb [8086]
LOOPE imm,ECX ; a32 E1 rb [386]
LOOPZ imm ; E1 rb [8086]
LOOPZ imm,CX ; a16 E1 rb [8086]
LOOPZ imm,ECX ; a32 E1 rb [386]
LOOPNE imm ; E0 rb [8086]
LOOPNE imm,CX ; a16 E0 rb [8086]
LOOPNE imm,ECX ; a32 E0 rb [386]
LOOPNZ imm ; E0 rb [8086]
LOOPNZ imm,CX ; a16 E0 rb [8086]
LOOPNZ imm,ECX ; a32 E0 rb [386]
LOOP decrements its counter register (ECX) by one, and if the counter does not become zero as a result of this operation, it jumps to the given label. The jump has a range of 128 bytes.
LOOPE (or its synonym LOOPZ) adds the additional condition that it only jumps if the counter is nonzero the zero flag is set. Similarly, LOOPNE (and LOOPNZ) jumps only if the counter is nonzero and the zero flag is clear.
EXAMPLE:
mov ecx 10
mov edi MyString
mov al '0'
L0: stosb | inc al | loopne L0<
LOOPE
Usage: LOOPE label Modifies flags: None
Decrements ECX by 1 (without modifying the flags) and transfers control to 'label' if ECX is not zero and the Zero Flag is set. The 'label' operand must be within -128 or 127 bytes of the instruction following the loop instruction.
Loop with Counter
LOOP imm ; E2 rb [8086]
LOOP imm,CX ; a16 E2 rb [8086]
LOOP imm,ECX ; a32 E2 rb [386]
LOOPE imm ; E1 rb [8086]
LOOPE imm,CX ; a16 E1 rb [8086]
LOOPE imm,ECX ; a32 E1 rb [386]
LOOPZ imm ; E1 rb [8086]
LOOPZ imm,CX ; a16 E1 rb [8086]
LOOPZ imm,ECX ; a32 E1 rb [386]
LOOPNE imm ; E0 rb [8086]
LOOPNE imm,CX ; a16 E0 rb [8086]
LOOPNE imm,ECX ; a32 E0 rb [386]
LOOPNZ imm ; E0 rb [8086]
LOOPNZ imm,CX ; a16 E0 rb [8086]
LOOPNZ imm,ECX ; a32 E0 rb [386]
LOOP decrements its counter register (ECX) by one, and if the counter does not become zero as a result of this operation, it jumps to the given label. The jump has a range of 128 bytes.
LOOPE (or its synonym LOOPZ) adds the additional condition that it only jumps if the counter is nonzero the zero flag is set. Similarly, LOOPNE (and LOOPNZ) jumps only if the counter is nonzero and the zero flag is clear.
EXAMPLE:
mov ecx 10
mov edi MyString
mov al '0'
L0: stosb | inc al | loope L0<
LOOP
Usage: LOOP label Modifies flags: None
Decrements ECX by 1 and transfers control to 'label' if ECX is not Zero. The 'label' operand must be within -128 or 127 bytes of the instruction following the loop instruction.
Loop with Counter
LOOP imm ; E2 rb [8086]
LOOP imm,CX ; a16 E2 rb [8086]
LOOP imm,ECX ; a32 E2 rb [386]
LOOPE imm ; E1 rb [8086]
LOOPE imm,CX ; a16 E1 rb [8086]
LOOPE imm,ECX ; a32 E1 rb [386]
LOOPZ imm ; E1 rb [8086]
LOOPZ imm,CX ; a16 E1 rb [8086]
LOOPZ imm,ECX ; a32 E1 rb [386]
LOOPNE imm ; E0 rb [8086]
LOOPNE imm,CX ; a16 E0 rb [8086]
LOOPNE imm,ECX ; a32 E0 rb [386]
LOOPNZ imm ; E0 rb [8086]
LOOPNZ imm,CX ; a16 E0 rb [8086]
LOOPNZ imm,ECX ; a32 E0 rb [386]
LOOP decrements its counter register (ECX) by one, and if the counter does not become zero as a result of this operation, it jumps to the given label. The jump has a range of 128 bytes.
LOOPE (or its synonym LOOPZ) adds the additional condition that it only jumps if the counter is nonzero the zero flag is set. Similarly, LOOPNE (and LOOPNZ) jumps only if the counter is nonzero and the zero flag is clear.
EXAMPLE:
mov ecx 10
mov edi MyString
mov al '0'
L0: stosb | inc al | loop L0<
LODSW
Usage: LODSW Modifies flags: None
Transfers string word addressed by ESI (even if an operand is supplied) to the accumulator. ESI is incremented based on the size of the operand or based on the instruction used. If the Direction Flag is set ESI is decremented, if the Direction Flag is clear ESI is incremented. Use with REP prefixes.
Load from String
LODSB ; AC [8086]
LODSW ; o16 AD [8086]
LODSD ; o32 AD [386]
LODSB loads a byte from ESI into AL. It then increments or decrements (depending on the direction flag: increments if the flag is clear, decrements if it is set) ESI.
LODSW and LODSD work in the same way, but they load a word or a doubleword instead of a byte, and increment or decrement the addressing registers by 2 or 4 instead of 1.
EXAMPLE:
L0: cmp ecx D$CaretLine | je L2
On ecx > D$LineNumber, ret
L1: lodsw | cmp al LF | jne L1<
inc ecx | jmp L0<