Volume 3: General-Purpose and System Instructions - Stanford ...
Volume 3: General-Purpose and System Instructions - Stanford ... Volume 3: General-Purpose and System Instructions - Stanford ...
AMD64 Technology 24594 Rev. 3.10 February 2005INTOInterrupt to Overflow VectorChecks the overflow flag (OF) in the rFLAGS register and calls the overflow exception(#OF) handler if the OF flag is set to 1. This instruction has no effect if the OF flag iscleared to 0. The INTO instruction detects overflow in signed number addition. SeeAMD64 Architecture Programmer’s Manual Volume 1: Application Programming for moreinformation on the OF flag.Using this instruction in 64-bit mode generates an invalid-opcode exception.For detailed descriptions of the steps performed by INT instructions, see thefollowing:• Legacy-Mode Interrupts: “Legacy Protected-Mode Interrupt Control Transfers” inVolume 2.• Long-Mode Interrupts: “Long-Mode Interrupt Control Transfers” in Volume 2.Mnemonic Opcode DescriptionINTOCECall overflow exception if the overflow flag is set.(Invalid in 64-bit mode.)ActionIF (64BIT_MODE)EXCEPTION[#UD]IF (RFLAGS.OF = 1)EXCEPTION [#OF]EXIT// #OF is a trap, and pushes the rIP of the instruction// following INTO.Related InstructionsINT, INT 3, BOUNDrFLAGS AffectedNone.ExceptionsException RealVirtual8086 Protected Cause of ExceptionOverflow, #OF X X X The INTO instruction was executed with 0F set to 1.Invalid opcode, #UD X Instruction was executed in 64-bit mode.164 INTO
24594 Rev. 3.10 February 2005 AMD64 TechnologyJccJump on ConditionChecks the status flags in the rFLAGS register and, if the flags meet the conditionspecified by the condition code in the mnemonic (cc), jumps to the target instructionlocated at the specified relative offset. Otherwise, execution continues with theinstruction following the Jcc instruction.Unlike the unconditional jump (JMP), conditional jump instructions have only twoforms—short and near conditional jumps. Different opcodes correspond to differentforms of one instruction. For example, the JO instruction (jump if overflow) hasopcode 0Fh 80h for its near form and 70h for its short form, but the mnemonic is thesame for both forms. The only difference is that the near form has a 16- or 32-bitrelative displacement, while the short form always has an 8-bit relative displacement.Mnemonics are provided to deal with the programming semantics of both signed andunsigned numbers. Instructions tagged A (above) and B (below) are intended for usein unsigned integer code; those tagged G (greater) and L (less) are intended for use insigned integer code.If the jump is taken, the signed displacement is added to the rIP (of the followinginstruction) and the result is truncated to 16, 32, or 64 bits, depending on operandsize.In 64-bit mode, the operand size defaults to 64 bits. The processor sign-extends the8-bit or 32-bit displacement value to 64 bits before adding it to the RIP.These instructions cannot perform far jumps (to other code segments). To create a farconditional-jumpcode sequence corresponding to a high-level language statementlike:IF A = B THEN GOTO FarLabelwhere FarLabel is located in another code segment, use the opposite condition in aconditional short jump before an unconditional far jump. Such a code sequence mightlook like:cmp A,B ; compare operandsjne NextInstr ; continue program if not equaljmp far FarLabel ; far jump if operands are equalNextInstr:; continue programFor details about control-flow instructions, see “Control Transfers” in Volume 1, and“Control-Transfer Privilege Checks” in Volume 2.Jcc 165
- Page 144 and 145: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 146 and 147: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 148 and 149: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 150 and 151: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 152 and 153: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 154 and 155: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 156 and 157: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 158 and 159: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 160 and 161: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 162 and 163: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 164 and 165: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 166 and 167: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 168 and 169: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 170 and 171: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 172 and 173: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 174 and 175: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 176 and 177: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 178 and 179: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 180 and 181: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 182 and 183: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 184 and 185: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 186 and 187: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 188 and 189: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 190 and 191: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 192 and 193: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 196 and 197: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 198 and 199: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 200 and 201: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 202 and 203: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 204 and 205: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 206 and 207: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 208 and 209: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 210 and 211: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 212 and 213: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 214 and 215: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 216 and 217: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 218 and 219: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 220 and 221: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 222 and 223: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 224 and 225: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 226 and 227: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 228 and 229: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 230 and 231: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 232 and 233: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 234 and 235: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 236 and 237: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 238 and 239: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 240 and 241: AMD64 Technology 24594 Rev. 3.10 Fe
- Page 242 and 243: AMD64 Technology 24594 Rev. 3.10 Fe
AMD64 Technology 24594 Rev. 3.10 February 2005INTOInterrupt to Overflow VectorChecks the overflow flag (OF) in the rFLAGS register <strong>and</strong> calls the overflow exception(#OF) h<strong>and</strong>ler if the OF flag is set to 1. This instruction has no effect if the OF flag iscleared to 0. The INTO instruction detects overflow in signed number addition. SeeAMD64 Architecture Programmer’s Manual <strong>Volume</strong> 1: Application Programming for moreinformation on the OF flag.Using this instruction in 64-bit mode generates an invalid-opcode exception.For detailed descriptions of the steps performed by INT instructions, see thefollowing:• Legacy-Mode Interrupts: “Legacy Protected-Mode Interrupt Control Transfers” in<strong>Volume</strong> 2.• Long-Mode Interrupts: “Long-Mode Interrupt Control Transfers” in <strong>Volume</strong> 2.Mnemonic Opcode DescriptionINTOCECall overflow exception if the overflow flag is set.(Invalid in 64-bit mode.)ActionIF (64BIT_MODE)EXCEPTION[#UD]IF (RFLAGS.OF = 1)EXCEPTION [#OF]EXIT// #OF is a trap, <strong>and</strong> pushes the rIP of the instruction// following INTO.Related <strong>Instructions</strong>INT, INT 3, BOUNDrFLAGS AffectedNone.ExceptionsException RealVirtual8086 Protected Cause of ExceptionOverflow, #OF X X X The INTO instruction was executed with 0F set to 1.Invalid opcode, #UD X Instruction was executed in 64-bit mode.164 INTO