ia-32_instruction-set-ref_a-m

The normal 2 byte opcode for int 3 cd03 does not have

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EIP IDT(Descriptor (vector_number 4), offset)); (* 16 bit offset AND 0000FFFFH *) END; PROTECTED-MODE: IF ((vector_number 8) + 7) is not within IDT limits or selected IDT descriptor is not an interrupt-, trap-, or task-gate type THEN #GP((vector_number 8) + 2 + EXT); FI; (* EXT is bit 0 in error code *) IF software interrupt (* Generated by INT n, INT 3, or INTO *) THEN IF gate descriptor DPL < CPL THEN #GP((vector_number 8) + 2 ); FI; (* PE = 1, DPL<CPL, software interrupt *) FI; IF gate not present THEN #NP((vector_number 8) + 2 + EXT); FI; IF task gate (* Specified in the selected interrupt table descriptor *) THEN GOTO TASK-GATE; ELSE GOTO TRAP-OR-INTERRUPT-GATE; (* PE = 1, trap/interrupt gate *) FI; END; IA-32e-MODE: IF ((vector_number 16) + 15) is not in IDT limits or selected IDT descriptor is not an interrupt-, or trap-gate type THEN #GP((vector_number 16) + 2 + EXT); FI; (* EXT is bit 0 in error code *) IF software interrupt (* Generated by INT n, INT 3, but not INTO *) THEN IF gate descriptor DPL < CPL THEN #GP((vector_number 16) + 2 ); FI; (* PE = 1, DPL < CPL, software interrupt *) 3-468 Vol. 2 INSTRUCTION SET REFERENCE, A-M ELSE (* Generated by INTO *) THEN #UD; FI; IF gate not present THEN #NP((vector_number 16) + 2 + EXT); FI; IF ((vector_number * 16)[IST] 0) NewRSP TSS[ISTx]; FI; GOTO TRAP-OR-INTERRUPT-GATE; (* Trap/interrupt gate *) END; TASK-GATE: (* PE = 1, task gate *) Read segment selector in task gate (IDT descriptor); IF local/global bit is set to local or index not within GDT limits THEN #GP(TSS selector); FI; Access TSS descriptor in GDT; IF TSS descriptor specifies that the TSS is busy (low-order 5 bits set to 00001) THEN #GP(TSS selector); FI; IF TSS not present THEN #NP(TSS selector); FI; SWITCH-TASKS (with nesting) to TSS; IF interrupt caused by fault with error code THEN IF stack limit does not allow push of error code THEN #SS(0); FI; Push(error code); FI; IF EIP not within code segment limit THEN #GP(0); FI; END; TRAP-OR-INTERRUPT-GATE: Read segment selector for trap or interrupt gate (IDT descriptor); IF segment selector for code segment is NULL THEN #GP(0H + EXT); FI; (* NULL selector with EXT flag set *) IF segment selector is not within its descriptor table limits THEN #GP(selector + EXT); FI; Read trap or interrupt handler descriptor; IF descriptor does not indicate a code segment or code segment descriptor DPL > CPL THEN #GP(selector + EXT); FI; IF trap or interrupt gate segment is not present, THEN #NP(selector + EXT); FI; IF code segment is non-conforming and DPL < CPL THEN Vol. 2 3-469 INSTRUCTION SET REFERENCE, A-M IF VM = 0 THEN GOTO INTER-PRIVILEGE-LEVEL-INTERRUPT; (* PE = 1, interrupt or trap gate, nonconforming code segment, DPL < CPL, VM = 0 *) ELSE (* VM = 1 *) IF code segment DPL 0 THEN #GP; (new code segment selector); GOTO INTERRUPT-FROM-VIRTUAL-8086-MODE; FI; (* PE = 1, interrupt or trap gate, DPL < CPL, VM = 1 *) FI; ELSE (* PE = 1, interrupt or trap gate, DPL CPL *) IF VM =...
View Full Document

This note was uploaded on 10/01/2013 for the course CPE 103 taught by Professor Watlins during the Winter '11 term at Mississippi State.

Ask a homework question - tutors are online