Microprocessors
535
Operation Address
Data
Memory
MOV A, 30H
09H
07H
22H
31H
30H
29H
(a)
(b)
Figure 13.5 Absolute addressing mode.
Operation Data
Figure 13.6 Immediate addressing mode.
13.5.2 Immediate Addressing Mode
In immediate addressing mode the value of the operand is held within the instruction itself (Fig. 13.6).
This mode is useful for accessing constant values in a program. It is faster than the absolute addressing
mode and requires less memory space. For example, the instruction MVI A, #30H moves the data
value 30H into the accumulator. The sign # in the instruction tells the assembler that the addressing
mode used is immediate.
13.5.3 Register Direct Addressing Mode
In register direct addressing mode, data are accessed by specifying the register name in which they
are stored [Fig. 13.7(a)]. Operations on registers are very fast, and hence instructions in this mode
require less time than absolute addressing mode instructions. As an example, the instruction MOV A,
R1 in the 8051 microprocessor moves the contents of register R1 into the accumulator [Fig. 13.7(b)].
The contents of the accumulator after the instruction are 06H.
13.5.4 Register Indirect Addressing Mode
In all the modes discussed so far, either the value of the data or their location is directly specified. The
indirect addressing mode uses a register to hold the actual address where the data are stored. That is,
in this case the memory location of the data is stored in a register [Fig. 13.8(a)]. In other words, in
indirect addressing mode, the address is specified indirectly and has to be looked up. This addressing
mode is useful when implementing the pointer data type of high-level language.
In the 8085 microprocessor, the R0 and R1 registers are used as an eight-bit index and the DPTR as
a 16-bit index. The mnemonic symbol used for indirect addressing is @. As an example, the instruction
Précédent

- 552/741

Suivant