I'm teaching my 12 y.o. 8086 assembly language and yesterday we were talking memory, addressing and segmentation. I showed him how segments can be visualized as a sequence of overlapping 64Kb blocks starting on 16 byte boundaries, with the offset being an 8080-style pointer within a segment. Then he asked a question I could not answer: why (what for, with what purpose) do they overlap?
Trying to research this question I found many copies of the 20 bit math, and a few vague mentions of some memory savings this scheme presumably allows. Can somebody elaborate on the memory saving part? Or any other ways to take practical advantage of the overlaps?
The less overlap, the less choice you'll have over where a segment starts in physical memory. That creates gaps between segments that are not useful, thus wasting memory. The design choice never creates a gap larger than 15 bytes. That's overdoing it a bit perhaps but 8086 was designed in an era where 1 megabyte was enough for everybody. And buying 64 kilobytes put a rather large dent in your budget. Precious enough to not want to waste on gaps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With