You are on page 1of 2

ADDRESSING MODES

The term addressing mode refers to the way in which the operand of an instruction is specified.
Information contained in the instruction code is the value of the operand or the address of the
result/operand.

8051 supports the following types of addressing modes.

1. Immediate mode

2. Direct addressing

3. Indirect addressing

4. Register instructions

5. Register specific

6. Indexed addressing

Symbols and Meanings of Addressing Modes of 8051

Rn Register R7-R0 of the currently selected


Register Bank.

direct 8-bit internal data location’s address. This


could be an Internal Data RAM location (0-
127) or a SFR [i.e., I/O port, control register,
status register, etc. (128-255)].

@Ri 8-bit internal data RAM location (0-255)


addressed indirectly through register R1or R0.

#data 8-bit constant included in instruction.

#data 16 16-bit constant included in instruction.


addr 16 16-bit destination address. Used by LCALL
and LJMP. A branch can be anywhere within
the 64K byte Program Memory address space.

addr 11 11-bit destination address. Used by ACALL


and AJMP. The branch will be within the
same 2K byte page of program memory as the
first byte of the following instruction.

1. IMMEDIATE ADDRESSING :

In immediate addressing mode, an immediate data i.e., a constant is specified in the


instruction itself.

A ‘#’ character is put before the data, to identify it as a data value and not as an address.
The destination register to which the constant data must be copied should be the same size as the
operand mentioned in the instruction.

Immediate Addressing is very fast as the data to be loaded is given in the instruction
itself.

 MOV A, #35H :- Move the immediate data 35H given in the instruction to A-register.
 MOV DPTR, #3000H :- Load the immediate 16-bit constant given in the instruction in
DPTR (Data pointer).

2. DIRECT ADDRESSING :

In direct addressing mode, the address of the data is directly specified in the instruction. The
direct address can be the address of an internal data RAM location (00H to 7FH) or address of
special function register (80H to FFH).

E.g.

 MOV A, 35 H :- This instruction will move the RAM location 35H to A-register
 MOV R0,89H : Here 89H is the address of a special function register TMOD
 MOV A,80H or MOV A,P0: Move contents of Port 0 (SFR at address 80H) to A

You might also like