Memory Segment - Data Segment (DS) - (ES, FS, GS)

Cpu Memory Management Segmented Model


The data segment are a segments that stores the data bit type.


The availability of four data segments permits efficient and secure access to different types of data structures.

For example, four separate data segments might be created:

  • one for the data structures of the current module,
  • another for the data exported from a higher-level module,
  • a third for a dynamically created data structure,
  • and a fourth for data shared with another program.

To access additional data segments, the application program must load segment selectors for these segments into the DS, ES, FS, and GS registers, as needed.


Segment Selector

The segment selector that locate the data segment are the DS, ES, FS, and GS segment register.


The DS, ES, FS, and GS registers registers contains the segment selector for their respective data segment.

General Purpose Register Name Use
EBX Base Pointer to data in the DS segment
Stream Operations
ESI Source Index Pointer to data in the segment pointed to by the DS register; source pointer for string operations, Used as a pointer to a source in stream operations
EDI Destination Index Pointer to data (or destination) in the segment pointed to by the ES register; destination pointer for string operations, Used as a pointer to a destination in stream operations

Documentation / Reference

Discover More
General Purpose Register 16 32 Bit
CPU Register - General Purpose Register (GPR)

The General purpose registers are available for storing: operands (input and output) and pointers Register Name Use EAX Accumulator Accumulator for operands and results data, Used in...
Segment Register Init Flat Memory Model
Memory Segment - Segment Register

The segment registers (CS, DS, SS, ES, FS, and GS) hold 16-bit segment selectors To access a particular segment in memory, the segment selector for that segment must be present in the appropriate segment...

Share this page:
Follow us:
Task Runner