536
Digital Electronics
Operation Register name
Data
Register
MOV A, R1
09H
06H
22H
R0
R1
R2
(a)
(b)
Figure 13.7 Register direct addressing mode.
Operation Register number
Memory
Register
MOV A, @R0
09
07
22
31H
30H
29H
(a)
(b)
Data
Memory
30H
R0
Figure 13.8 Register indirect addressing mode.
MOV A, @R0 moves the contents of the memory location whose address is stored in R0 into the
accumulator. The value of the accumulator in this example is 07H [Fig. 13.8(b)]. This addressing mode
can also be enhanced with an offset for accessing data structures in data space memory. This is referred
to as register indirect with displacement. As an example, the instruction MOVC A, @A+DPTR copies
the code byte at the memory address formed by adding the contents of A and DPTR to A.
13.5.5 Indexed Addressing Mode
In the indexed addressing mode, the address is obtained by adding the contents of a register to a
constant (Fig. 13.9). The instruction ‘move the contents of accumulator A to the memory location
whose address is given by the contents of register 1 plus 5’ is an example of indexed addressing. The
indexed addressing mode is useful whenever the absolute location of the data is not known until the
program is running. This addressing mode is used to access a continuous table or array of data items
stored in memory. The content of the constant gives the starting address, while the contents of the
Précédent

- 553/741

Suivant