Reference - Addressing Modes
Reference - Addressing Modes
Addressing Modes
The 8086 Addressing Mode When the 8086 executes an instruction, it performs
the specified function on data. The data are called its operands and may be part
of the instruction reside in one of the internal registers of the 8086, stored at an
address in memory, or held at an I/O port. To access these different types of
operands, the 8086 is provided with various addressing modes:
MOV AX, BX
This stands for move the contents of BX, the source operand, to AX, the
destination operand. Both the source and destination operands have been
specified as the content of the internal registers of the 8086. See Figure 10(a, b).
1
Addressing Mode
effected memory address (EA) instead of data. This effective address is a 16-
bit offset of the storage location of the operand from the current value in the
2
Addressing Mode
data segment (DS) register. EA is combined with the contents of DS in the BIU
This stands for move the contents of the memory location which is offset by
BETA from the current value in DS into internal register CX. See Figure 12(a,
b). Notice that the value assigned to constant BETA is 1234H.
PA = 02000H + 1234H
= 03234H
3
Addressing Mode
within the 8086. The pointer register can be either BX or BP and the index
This instruction moves the contents of the memory location offset by the value
of EA in SI from the current value in DS to the AX register. See Figure 13(a, b).
SI contains 1234H and DS contains 0200H.
PA = 02000H + 1234H
= 03234H
4
Addressing Mode
MOV [BX].BETA, AL
As shown in Figure 14(a, b) the fetch and execution of this instruction causes
the BIU to calculate the physical address of the destination operand from the
contents of DS, BX, and the direct displacement. The result is
= 04234H
based addressing, it uses the contents of one of the index registers, instead of
5
Addressing Mode
The example in Figure 15(a,b) shows the result of executing the MOV
instruction. First the physical address for the source operand is calculated from
DS, SI, and the direct displacement.
= 05234H
Then the byte of data stored at this location, which is BEH is read into lower
byte AL of the accumulator register.
and the indexed addressing mode together results in a new, more powerful
6
Addressing Mode
= 06234H
set automatically use the source and destination index registers to specify the
MOVS
is an example. Notice that neither SI nor DI appears in the string instruction, but
both are used during its execution.
7
Addressing Mode
IN AL, 15H
This stands for input the data from the byte wide input port at address 15H of
the I/O address space to register AL. Next, let us consider another example.
Using Indirect port addressing for the source operand in an IN instruction, we
get:
IN AL, DX
It means input the data from the byte wide input port whose address is specified
by the contents of register DX. For instance, if DX equals 1234H the contents of
Problems
Find the memory address of the next instruction execute by the micro
processor for the following CS:IP combinations:
8
Chapter Three Addressing Mode
Which register or registers are used as an offset address for string instruction
destination in the microprocessor?
Categorize each flag bit of the 8086 as either a control flag or as a flag to
monitor the effect of instruction execution.
Identify the source and destination operand for each of the statements in 10.