User's Manual

Vol. 3 3-17
PROTECTED-MODE MEMORY MANAGEMENT
Stack segments are data segments which must be read/write segments. Loading the
SS register with a segment selector for a nonwritable data segment generates a
general-protection exception (#GP). If the size of a stack segment needs to be
changed dynamically, the stack segment can be an expand-down data segment
(expansion-direction flag set). Here, dynamically changing the segment limit causes
stack space to be added to the bottom of the stack. If the size of a stack segment is
intended to remain static, the stack segment may be either an expand-up or expand-
down type.
The accessed bit indicates whether the segment has been accessed since the last
time the operating-system or executive cleared the bit. The processor sets this bit
whenever it loads a segment selector for the segment into a segment register,
assuming that the type of memory that contains the segment descriptor supports
processor writes. The bit remains set until explicitly cleared. This bit can be used both
for virtual memory management and for debugging.
Table 3-1. Code- and Data-Segment Types
Type Field Descriptor
Type
Description
Decimal 11 10
E
9
W
8
A
0 0 0 0 0 Data Read-Only
1 0 0 0 1 Data Read-Only, accessed
2 0 0 1 0 Data Read/Write
3 0 0 1 1 Data Read/Write, accessed
4 0 1 0 0 Data Read-Only, expand-down
5 0 1 0 1 Data Read-Only, expand-down, accessed
6 0 1 1 0 Data Read/Write, expand-down
7 0 1 1 1 Data Read/Write, expand-down, accessed
C R A
8 1 0 0 0 Code Execute-Only
9 1 0 0 1 Code Execute-Only, accessed
10 1 0 1 0 Code Execute/Read
11 1 0 1 1 Code Execute/Read, accessed
12 1 1 0 0 Code Execute-Only, conforming
13 1 1 0 1 Code Execute-Only, conforming, accessed
14 1 1 1 0 Code Execute/Read, conforming
15 1 1 1 1 Code Execute/Read, conforming, accessed