Memory Segmentation: The memory in an 8086 microprocessor is organized as a segmented memory. The physical memory is divided into 4 segments namely, - Data segment, Code Segment, Stack Segment and Extra Segment.
Description: Data segment is used to hold data, Code segment for the executable program, Extra segment also holds data specifically in strings and stack segment is used to store stack data. Each segment is 64Kbytes & addressed by one segment register. i.e CS,DS,ES or SS The 16 bit segment register holds the starting address of the segment The offset address to this segment address is specified as a 16-bit displacement (offset) between 0000 to FFFFH. Since the memory size of 8086 is 1Mbytes, total 16 segments are possible with each having 64Kbytes.
Advantages of segmentation: 1) With the use of segmentation the instruction and data is never overlapped. 2) The major advantage of segmentation is Dynamic relocatability of program which means that a program can easily be transferred from one code memory segment to another code memory segment without changing the effective address. 3) Segmentation can be used in multi-user time shared system. 4) Segmentation allows two processes to share data. 5) Segmentation allows you to extend the addressability of a processor i.e., address up to 1MB although the actual addresses to be handled are of 16 bit size. 6) Programs and data can be stored separately from each other in segmentation.