beautypg.com

Intel 253666-024US User Manual

Page 521

background image

Vol. 2A 3-475

INSTRUCTION SET REFERENCE, A-M

INT n/INTO/INT 3—Call to Interrupt Procedure

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

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 *)