Memory Segmentation
Memory Segmentation
• As 8086 has got 20 address lines, it’s addressing capability is 1 M Byte memory locations.
• The physical address is calculated from segment address and offset address as given below Physical
address=10*segment addr + offset addr
Memory Segmentation
• In this scheme, the complete physically available memory may be divided into a number of logical
segments.
• Each segment is 64 Kbytes in size and is addressed by one of the segment register.
• The 16 bit contents of the segment register actually point to the starting location of a particular
segment.
• The offset address is also 16 bit long so that the maximum offset value can be FFFFH, and the
maximum size of any segment is thus 64 K locations.
• To emphasize this segmented memory concept, we will consider an example of a housing colony
containing say, 100 houses
• In the second scheme, the efforts required for finding the same house will be too less.
• This second scheme in our example is analogous to the segmented memory scheme, where the
addresses are specified in terms of segment addresses analogous to rows and offset addresses
analogous to columns
• The complete 1 Mbytes memory can be divided into 16 segments, each of 64 Kbytes size.
• The offset address values are from 0000H and FFFFH so that the physical addresses range from
00000H to FFFFFH.
• In the above said case, the segments are called non-overlapping segments which are shown in Figure
1.3a.
• But, if another segment starts before this 64 kbytes locations of the first segment, the two segments
are said to be overlapping segments.
• The area of memory from the start of the second segment to the possible end of the first segment is
called an overlapped segment area • Figure 1.3b explains the phenomenon more clearly.
• The locations lying in the overlapped area may be addressed by the same physical address generated
from two different sets of segment and offset addresses.
– 1 Allows the memory capacity to be 1 Mbytes although the actual addresses to be handled are of 16
bit size.
– 2 Allows the placing of the code, data, and stack portions of the same program in different parts of
memory for data and code protection.
– 3 Permits a program and/or its data to be put into different areas of memory each time the program is
executed i.e. provision for relocation is done.
• In the overlapped Area locations physical address =CS1+ IP1 = CS2 + IP2 where + indicates the
procedure of physical address formation