                               The ES Register

Extra Segment


Graphical Breakdown:

      [       16 bits       ]
               ES

ES register is like the DS register.  You can put a segment in it to access
an alternate segment than what is currently in DS.  Some instructions use
ES as a Destination Segment (MOVS*, STOS*).
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.

ES 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 ES typecast is:
26h


During startup of a .COM/.EXE in DOS ES  will hold the segment of the PSP.