Calculating a 20-bit address

On pages 37-38, the book explains how to calculate a 20-bit address from two 16-bit registers. The 20-bit address is known as an absolute address, since it is a direct reference into the 1 MB memory space of the 8088 computer. The problem with the 8088 computer is that there are only 16-bit registers, so that something extra must be done to generate a 20-bit address. Part of the 8088 CPU is dedicated to generating 20-bit absolute addresses. The input to the address generator is two 16-bit numbers: one representing a segment and one representing an offset. The segment input will be from one of the segment registers: CS, DS, SS, ES. The other input will be from a base, index, or control register, or will be an immediate value. To generate the 20-bit address, the CPU shifts the segment 4 bits (1 hex digit) to the left and adds the offset to it.

A common combination for segment and offset is the CS and IP registers: together they indicate the address of the next instruction. As an example, suppose the CS register contains ABCDh and the IP register contains 0046h.