                               The DS Register

Data Segment


Graphical Breakdown:

      [       16 bits       ]
               DS

DS holds the default segment for accessing data.  If you do not specify a segment
when you access any kind of memory, it will default to DS.  
Some instructions use DS as a Source Segment (LODS*, MOVS*).
In Real Mode, this register holds a segment but in protected mode, it is called a
segment selector.


In real mode:
Segment*16 + Offset = 20 Bit Physical Address below 1 Meg.

DS Holds the segment part.  Each Segment can reference 65536 bytes, but,
they overlap.  Every Segment (In increments of 1) is 16 bytes apart.
Example:

0000h:0000h  0*16 + 0 = 00000h Physical.

Increment Segment by 1
0001h:0000h  1*16 + 0 = 00010h Physical.


So, 0000h:0000h to 0000h:0000Fh is unique and Can only be addressed by that segment. 

Where as

0000h:0010h  and 0001:0000h Are the same address.



In protected mode, you can address up to 4 Gigabytes of Memory at a time.
The "Segment Selector" selects a descriptor in a Descriptor Table.

The machine code for a DS typecast is:
3Eh

During Startup of a .COM/.EXE in DOS DS will hold the segment of the PSP.
