13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AMD64 Technology 24594 Rev. 3.10 February 2005INT 3Interrupt to Debug VectorCalls the debug exception h<strong>and</strong>ler. This instruction maps to a 1-byte opcode (CC) thatraises a #BP exception. The INT 3 instruction is normally used by debug software toset instruction breakpoints by replacing the first byte of the instruction opcode byteswith the INT 3 opcode.This one-byte INT 3 instruction behaves differently from the two-byte INT 3instruction (opcode CD 03) (see “INT” in Chapter 3 “<strong>General</strong> <strong>Purpose</strong> <strong>Instructions</strong>”for further information) in two ways:• The #BP exception is h<strong>and</strong>led without any IOPL checking in virtual x86 mode.(IOPL mismatches will not trigger an exception.)• In VME mode, the #BP exception is not redirected via the interrupt redirectiontable. (Instead, it is h<strong>and</strong>led by a protected mode h<strong>and</strong>ler.)Mnemonic Opcode DescriptionINT 3 CC Trap to debugger at Interrupt 3.For complete 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.Action// Refer to INT instruction’s Action section for the details on INT_N_REAL,// INT_N_PROTECTED, <strong>and</strong> INT_N_VIRTUAL_TO_PROTECTED.INT3_START:If (REAL_MODE)INT_N_REAL //N = 3ELSEIF (PROTECTED_MODE)INT_N_PROTECTED //N = 3ELSE // VIRTUAL_MODEINT_N_VIRTUAL_TO_PROTECTED //N = 3Related <strong>Instructions</strong>INT, INTO, IRET304 INT 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!