Intel 80286, 80287 manual Gate Descriptor Format Call Gates

Models: 80287 80286

1 515
Download 515 pages 45.04 Kb
Page 143
Image 143

PROTECTION

D1

+7

 

INTEL RESERVED'

+6

+5

pi DPL \01

TYPE jx X Xl COUNTWORD ....,

+4

+3

DESTINATION SELECTOR'5-2 IX

X +2

+1

DESTINATION OFFSET,s-a

 

 

IS

• 7

 

Gate Descriptor Fields

Name

Value

 

Description

 

4

Call Gate.

TYPE

5

Task Gate.

6

Interrupt Gate.

 

 

7

Trap Gate.

P

0

Descriptor Contents are

not valid.

 

 

 

1

Descriptor Contents are

 

 

valid.

 

DPL

0-3

Descriptor Privilege Level.

 

 

 

WORD

 

Number of words to copy

COUNT

0-31

from

caller's stack to

 

called

procedure'sstack.

 

 

Only used with call gate.

'Mustbe set to 0 for compatibility

DESTINA-

Selector to the target code segment (Call, Interrupt or

with 80386 (X is don'tcare)

TION

16-bit

Trap Gate).

SELECTOR

selector

Selector to the target task state segment (Task Gate).

DESTINA- 16-bit

TION offset

OFFSET

Entry point within the target code segment.

G30108

Figure 7-10. Gate Descriptor Format

7.5.1.1 CALL GATES

Call gate descriptors are used by call and jump instructions in the same manner as a code segment descriptor. The hardware automatically recognizes that the destination selector refers to a gate descrip- tor. Then, the operation of the instruction is expanded as determined by the contents of the call gate. A jump instruction can access a call gate only if the target code segment is at the same privilege level. A call instruction uses a call gate for the same or more privileged access.

A call gate descriptor may reside in either the GDT or the LDT, but not in the IDT. Figure 7-10 gives the complete layout of a call gate descriptor.

A call gate can be referred to by either the long JMP or CALL instructions. From the viewpoint of the program executing a JMP or CALL instruction, the fact that the destination was reached via a call gate and not directly from the destination address of the instruction is not apparent.

7-17

Page 143
Image 143
Intel 80286, 80287 manual Gate Descriptor Format Call Gates