Figure 2-12 Branch-related addressing modes.

(a) Intrasegment direct
(b) Intrasegment indirect
(c) Intersegment direct
(d) Intersegment indirect
*EA is added to 1610 times the contents of the appropriate segment register.

The addressing modes for indicating branch addresses are graphically defined in Fig. 2-12 and are:

Intrasegment Direct
The effective branch address is the sum of an 8- or 16-bit displacement and the current contents of IP. When the displacement is 8 bits long, it is referred to as a short jump. Intrasegment direct addressing is what most computer books refer to as relative addressing because the displacement is computed "relative" to the IP. It may be used with either conditional or unconditional branching, but a conditional branch instruction can have only an 8-bit displacement.
Intrasegment Indirect
The effective branch address is the contents of a register or memory location that is accessed using any of the above data-related addressing modes except the immediate mode. The contents of IP are replaced by the effective branch address. This addressing mode may be used only in unconditional branch instructions.
Intersegment Direct
Replaces the contents of IP with part of the instruction and the contents of CS with another part of the instruction. The purpose of this addressing mode is to provide a means of branching from one code segment to another.
Intersegment Indirect
Replaces the contents of IP and CS with the contents of two consecutive words in memory that are referenced using any of the above data-related addressing modes except the immediate and register modes.
Note that the physical branch address is the new contents of IP plus the contents of CS multiplied by 1610. An intersegment branch must be unconditional.

To demonstrate how indirect branching works with some of the data-related addressing modes, suppose that

(BX) = 1256    (SI) = 528F    Displacement = 20A1

Then:

With direct addressing, the effective branch address is the contents of:

20A1 + (DS)*1610
With register relative addressing assuming register BX, the effective branch address is the contents of:
1256 + 20A1 + (DS)*1610
With based indexed addressing assuming registers BX and SI, the effective branch address is the contents of:
1256 + 528F + (DS)*1610


Table of Contents | Next page | Previous page

This is page 16.