Figure (a) shows the segment memory of an 8086 microprocessor. The address of 1st segment memory is 0000011 to OFFFFH. For these addresses, the content of segment register is 0000H and the offset address. I.e. the content of Instruction Pointer (IP) varies from 0000H to FFFFH. The physical address of memory is computed from the content of segment register x $(10)_{16}+$ offset address.
Similarly, the second segment memory address is 10000H to 1 FFFFH. In this case, the content of segment register is 1000H and the offset address is any value from 0000H to FFFFH. In the same way, other segment memory addresses are —20000H to 2FFFFH, 30000H to 3FFEFH, 40000H to 4FFFFH, 50000H to 5FFFFH, E0000H to EFFFFH, and F0000H to FFFFFH. In this case, the segments are non-overlapping and this type of memory segmentation is called non-overlapping memory segments.
Sometimes the segments are overlapping. For example, if a segment starts at a particular address, it will continue up to 64 K bytes. When another segment memory starts before 64K memory locations of the first segment, the two segments should be overlapped.
Assume the content of CS segment register CS = 2500H and the content of DS segment register DS = 2540H and the offset address varies from 000011 to FFFFH. The code segment register (CS) and offset address can represent the memory segment address starting from 25000H to 25000H0+FFFFH=34FFFH.
Similarly, the data segment DS and content of IP can address the memory segment address starting from 25400H to 25400H + FFFFH= 353FFH as depicted in Fig. (b).
It is clear from Fig.(b) that some portion of the segments are overlapping and this overlapping portion of the segment memory is called an overlapped segment area.
The address locations of overlapping may be located from different sets of segments and offset addresses. Therefore, different sets of segments and offset address can locate the physical memory locations with non-overlapping segments and overlapping segments.
The advantages of segment memory are given below:
Allow the memory capacity to be 1 MB even though the addresses associated with the individual instructions are 16 bits wide.
Allow the use of separate memory areas for the program code and data and stack portion of the program.
Permit a program and/or its data to be placed into different areas of memory whenever the program is end.
Multitasking becomes easy
The advantage of having separate code and data segments is that one program can work on different sets of data This is possible by reloading the data segment register (DS) to the point to the new data.
The advantage of segment memory is that the reference logical addressed can be loaded into the instruction pointer (IP) and run the program anywhere in the segment memory as the logical address varies from 0000H to FFFFH.
Programs are re-locatable so that programs can be run at any location in the memory.