The instruction pointer (IP) and SP registers are essentially the program counter and stack pointer registers, but the complete instruction and stack addresses are formed by adding the contents of these registers to the contents of the code segment (CS) and stack segment (SS) registers discussed below.

an example, if (CS) = 123A and (IP) = 341B, then the next instruction will be fetched from

341BEffective address
+ 123A0Beginning segment address
157BBPhysical address of instruction

Figure 2-3 Formation of a physical address.

The advantages of using segment registers are that they:

  1. Allow the memory capacity to be 1 megabyte even though the addresses associated with the individual instructions are only 16 bits wide.
  2. Allow the instruction, data, or stack portion of a program to be more than 64K bytes long by using more than one code, data, or stack segment.
  3. Facilitate the use of separate memory areas for a program, its data, and the stack.
  4. Permit a program and/or its data to be put into different areas of memory each time the program is executed.

Figure 2-4 Address computations and memory segmentation.

(a) Address within segment(b) Overlapping segments

Table of Contents | Next page | Previous page

This is page 11.