                               The GS Register

G Segment


Graphical Breakdown:

      [       16 bits       ]
               GS

GS is just an extra segment register added on with 386+ processors.
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.

GS 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 GS typecast is:
65h

During startup of a .COM/.EXE in DOS, GS will be unknown.