3-16 Vol. 3
PROTECTED-MODE MEMORY MANAGEMENT
G (granularity) flag
Determines the scaling of the segment limit field. When the
granularity flag is clear, the segment limit is interpreted in byt e
units; when flag is set, the segment limit is interpreted in
4-KByte units. (This flag does not affect the granularity of the
base address; it is always byte granular.) When the granularity
flag is set, the twelve least significant bits of an offset are not
tested when checking the offset against the segment limit. For
example, when the granularity flag is set, a limit of 0 results in
valid offsets from 0 to 4095.
L (64-bit code segment) flag
In IA-32e mode, bit 21 of the second doubleword of the segment
descriptor indicates whether a code segment contains native 64-bit
code. A value of 1 indicates instructions in this code segment are
executed in 64-bit mode. A value of 0 indicates the instructions in this
code segment are executed in compatibility mode. If L-bit is set, then
D-bit mus t be clear ed. When n ot in IA-3 2e mode o r for non- code
segments, bit 21 is reserved and should always be set to 0.
Available and reserved bits
Bit 20 of the second doubleword of the segment descriptor is available
for use by system software.
3.4.5.1 Code- and Data-Segment Descriptor Types
When the S (descriptor type) flag in a segment descriptor is set, the descriptor is for
either a code or a data segment. The highest order bit of the type field (bit 11 of the
second double word of the segment descriptor) then determines whether the
descriptor is for a data segment (clear) or a code segment (set).
For data segments, the three low-order bits of the type field (bits 8, 9, and 10) are
interpreted as accessed (A), write-enable (W), and expansion-direction (E). See
Tabl e 3- 1 for a description of the encoding of the bits in the type field for code and
data segments. Data segments can be read-only or read/write segments, depending
on the setting of the write-enable bit.