0
7.9kviews
What are the advantages of memory segmentation of 8086.
1 Answer
1
298views
  • Segmentation means dividing the memory into logically different parts called segments. 8086 has a 20-bit address bus, hence it can access 1MB memory. It is not possible to work with a 20 bit address as it is not a byte compatible number i.e. (20 bits is two and a half bytes).
  • To avoid working with this incompatible number, we create a virtual model of the memory. Here the memory is divided into 4 segments: Code, Stack Data and Extra. The max size of a segment is 64KB and the minimum size is 16 bytes.

Memory Segmentation

  • Now programmer can access each location with a VIRTUAL ADDRESS. The Virtual Address is a combination of Segment Address and Offset Address. Segment Address indicates where the segment is located in the memory (base address) and Offset Address gives the offset of the target location within the segment.
  • Since both, Segment Address and Offset Address are 16 bits each, they both are compatible numbers and can be easily used by the programmer. Hence, we can access 1 MB memory using only a 16 bit offset address for most part of the program.
  • This is the advantage of segmentation that it permits the programmer to access 1MB using only 16-bit address and it divides the memory logically to store Instructions, Data and Stack separately. Moreover, dividing Code, stack and Data into different segments, makes the memory more organized and prevents accidental overwrites between them.
  • The physical address is calculated by the microprocessor, using the formula:

Physical Address (20 bit) = Segment Address(16 bit) X 10H + Offset Address (16 bit)

Please log in to add an answer.