The CPU can access data various ways
The data could be in a register, or memory
or as an immediate value
The various ways of accessing data are
called addressing modes.
Prof. Nitin Ahire 2
1)Direct addressing mode
2)Indirect addressing mode
4)Register specific addressing (optional)
6)External Addressing ( Index )
a) Code access b) Data access
Prof. Nitin Ahire 3
In this mode the operand is specified by an
8-bit address field In the instruction.
One can access all the 128 bytes of internal
RAM locations and each SFR.
If the MSB bit = 0 then the location is within
on chip internal RAM. If MSB bit = 1
then the location is SFR.
Prof. Nitin Ahire 4
The location 00h to 7Fh to address the
internal RAM .
SFR addresses from 80h to FF h
e.g. MOV A,40h
Prof. Nitin Ahire 5
In this addressing mode, the instruction
specifics a register which contains address
of an operand
i.e. the register hold the actual address that
will be used in the data move operation.
The R0 and R1 of each bank can be used as an
index or pointer to memory location
Prof. Nitin Ahire 6
The sign @ indicates the register acts as a
pointer to memory locations
E.g. MOV A,@ R1
Note : only register R0 and R1 can be used
for indirect addressing mode .
MOV A,@R2 invalid instruction.
Prof. Nitin Ahire 7
Each bank consist of register R0 to R7 can be
used as general purpose register for selection
of bank register, the user has to modify the
two bits of PSW
These register can be used to stored the
address or data in the register addressing
Prof. Nitin Ahire 8
MOV A, R1
Note: MOV R2,R7 is an invalid instruction
Prof. Nitin Ahire 9
In this addressing mode the instruction refer
to a specific registers such as accumulator or
Prof. Nitin Ahire 10
This method is the simplest method to get
In this addressing mode the source operand is
a constant rather then a variable.
As the data source is a part of instruction
The # sign indicates that the data followed is
Prof. Nitin Ahire 11
MOV DPTR, #1234h
Prof. Nitin Ahire 12
(a) Code access (ROM access)
Using these instructions only program
memory can be accessed.
This addressing mode is preferred for
reading look up tables in the program
Either DPTR or PC can be used as pointer.
Prof. Nitin Ahire 13
Prof. Nitin Ahire 14
(b) Data access (RAM access)
Using this addressing mode the programmer
can access the external Data memory
E.g. MOVX A,@DPTR
Prof. Nitin Ahire 15