3-506 Vol. 2A Jcc—Jump if Condition Is Met
INSTRUCTION SET REFERENCE, A-M
checked is determined by the address-size attribute. These instructions are useful
when used at the beginning of a loop that terminates with a conditional loop instruc-
tion (such as LOOPNE). They can be used to prevent an instruction sequence from
entering a loop when RCX, ECX or CX is 0. This would cause the loop to execute 2
64
,
2
32
or 64K times (not zero times).
All conditional jumps are converted to code fetches of one or two cache lines, regard-
less of jump address or cacheability.
In 64-bit mode, operand size is fixed at 64 bits. JMP Short is RIP = RIP + 8-bit offset
sign extended to 64 bits. JMP Near is RIP = RIP + 32-bit offset sign extended to
64-bits.
Operation
IF condition
THEN
tempEIP ← EIP + SignExtend(DEST);
IF OperandSize = 16
THEN tempEIP ← tempEIP AND 0000FFFFH;
FI;
IF tempEIP is not within code segment limit
THEN #GP(0);
ELSE EIP ← tempEIP
FI;
FI;
Protected Mode Exceptions
#GP(0) If the offset being jumped to is beyond the limits of the CS
segment.
#UD If the LOCK prefix is used.
Real-Address Mode Exceptions
#GP If the offset being jumped to is beyond the limits of the CS
segment or is outside of the effective address space from 0 to
FFFFH. This condition can occur if a 32-bit address size override
prefix is used.
#UD If the LOCK prefix is used.
Virtual-8086 Mode Exceptions
Same exceptions as in real address mode.