Electronic – 8086 Memory segment falling on 16-byte boundaries

microprocessor

I was reading in 8086 datasheet and I found this phrase that I couldn't understand in memory organisation :

memory is logically divided into code, data, extra data, and stack
segments of up to 64K bytes each, with each segment falling on
16-byte boundaries
.

I know what segmants mean but what they mean by "… segment falling on 16-byte boundaries…

Best Answer

This means that each segment starts at an address that is a multiple of 16. This is achieved as follows.

Addresses in 8086 are 20 bit long. Addresses are computed from a segment start and an offset, both are 16 bit. The 16-bit segment start is shifted left by 4, then the offset is added. These two operations are performed in a 20-bit register, so the result is a 20-bit address.

Since the segment start is shifted left by 4 the result of this shift has its lower 4 bits set to zero at all times and so is a multiple of 16. There's no way for a segment to start at an address that is not a multiple of 16 because of this.