<<<    Index    >>>
3-311
INSTRUCTION SET REFERENCE
INT n/INTO/INT 3—Call to Interrupt Procedure (Continued)
ELSE (* TSS is 16-bit *)
TSSstackAddress 
<
 (new code segment DPL 
?
 4) + 2
IF (TSSstackAddress + 4) 
>
 TSS limit
THEN #TS(current TSS selector); FI;
NewESP 
<
 TSSstackAddress;
NewSS 
<
 TSSstackAddress + 2;
FI;
IF segment selector is null THEN #TS(EXT); FI;
IF segment selector index is not within its descriptor table limits
OR segment selector’s RPL 
?
 DPL of code segment, 
THEN #TS(SS selector + EXT);
FI;
Read segment descriptor for stack segment in GDT or LDT;
IF stack segment DPL 
?
 DPL of code segment, 
OR stack segment does not indicate writable data segment, 
THEN #TS(SS selector + EXT);
FI;
IF stack segment not present THEN #SS(SS selector+EXT); FI;
IF 32-bit gate
THEN
IF new stack does not have room for 24 bytes (error code pushed) 
OR 20 bytes (no error code pushed)
THEN #SS(segment selector + EXT); 
FI;
ELSE (* 16-bit gate *)
IF new stack does not have room for 12 bytes (error code pushed) 
OR 10 bytes (no error code pushed);
THEN #SS(segment selector + EXT); 
FI;
FI;
IF instruction pointer is not within code segment limits THEN #GP(0); FI;
SS:ESP 
<
 TSS(NewSS:NewESP) (* segment descriptor information also loaded *)
IF 32-bit gate
THEN 
CS:EIP 
<
 Gate(CS:EIP); (* segment descriptor information also loaded *)
ELSE (* 16-bit gate *)
CS:IP 
<
 Gate(CS:IP); (* segment descriptor information also loaded *)
FI;
IF 32-bit gate
THEN
Push(far pointer to old stack); (* old SS and ESP, 3 words padded to 4 *);
Push(EFLAGS);
Push(far pointer to return instruction); (* old CS and EIP, 3 words padded to 4*);
Push(ErrorCode); (* if needed, 4 bytes *)
<<<    Index    >>>